Heriman/n8nworkflows_ver_sales_unformated huggingface dataset:
n8n workflow: New WooCommerce Product to Twitter and Telegram

Nodes:
name: Twitter
type: n8n-nodes-base.twitter
parameters: text: =✨ New Product Announcement ✨
We have just added {{$json["name"]}}, Head to {{$json["permalink"]}} to find out more.
name: Telegram
type: n8n-nodes-base.telegram
parameters: text: =✨ New Product Announcement ✨
We have just added {{$json["name"]}}, Head to {{$json["permalink"]}} to find out more.
chatId: 123456
name: WooCommerce Trigger
type: n8n-nodes-base.wooCommerceTrigger
parameters: event: product.created

Connections:
WooCommerce Trigger: main: node: Twitter
type: main
node: Telegram
type: main
Nodes:
name: Split Out
type: n8n-nodes-base.splitOut
parameters: fieldToSplitOut: Email
name: Remove Duplicates
type: n8n-nodes-base.removeDuplicates
onError: continueRegularOutput
retryOnFail: yes
name: Respond to Webhook
type: n8n-nodes-base.respondToWebhook
name: Sticky Note
type: n8n-nodes-base.stickyNote
parameters: color: 4
width: 1764.2311804548722
height: 309.99889350400827
content: 
* Scraping emails from websites using an api
name: Sticky Note1
type: n8n-nodes-base.stickyNote
parameters: color: 5
width: 520.3009626085002
height: 249.39327996703526
content: 
* Call the webhook using a query parameter eg 

http://localhost:5678/webhook/ea568868-5770-4b2a-8893-7e?Website=https://mailsafi.com

HTTP request rest the query Website and gets the emails therein
name: Sticky Note2
type: n8n-nodes-base.stickyNote
parameters: width: 728.4741979436378
height: 430.0825742795921
content: # How to scrap emails from websites

This workflow shows how you can quickly build an Email scraping API using n8n.
Usage
Copy the webhook URL to your browser and add a query parameter eg {{$n8nhosteingurl/webhook/ea568868-5770-4b2a-8893-700b344c995e?Website=https://mailsafi.com
This will return the email address on the website or if there is no email, the response will be "workflow successfully executed"

# Make sure to use HTTP:// for your domains

Otherwise, you may get an error. 




name: Webhook
type: n8n-nodes-base.webhook
parameters: path: ea568868-5770-4b2a-8893-700b344c995e
responseMode: responseNode
name: Get the website data
type: n8n-nodes-base.httpRequest
onError: continueRegularOutput
parameters: url: ={{ $json.query['Website'] }}
retryOnFail: yes
name: Extract the emails found
type: n8n-nodes-base.set
parameters: assignments: assignments: name: Email
type: array
value: ={{$json.data.match(/(?:[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,})/g)}}
name: If contains email
type: n8n-nodes-base.if
parameters: conditions: options: caseSensitive: yes
typeValidation: strict
combinator: and
conditions: operator: type: string
operation: notEmpty
singleValue: yes
leftValue: ={{ $json.Email }}

Connections:
Webhook: main: node: Get the website data
type: main
Split Out: main: node: If contains email
type: main
If contains email: main: node: Remove Duplicates
type: main
Remove Duplicates: main: node: Respond to Webhook
type: main
Get the website data: main: node: Extract the emails found
type: main
Extract the emails found: main: node: Split Out
type: main
Nodes:
name: On clicking 'execute'
type: n8n-nodes-base.manualTrigger
name: HTTP Request
type: n8n-nodes-base.httpRequest
parameters: url: ={{$node["Config URL"].json["next"]}}
queryParametersUi: parameter: name: hapikey
value: <YOUR_API_KEY>
name: limit
value: 100
name: NoOp
type: n8n-nodes-base.noOp
name: Wait
type: n8n-nodes-base.function
parameters: functionCode: return new Promise((resolve, reject) => {
      setTimeout(() => { resolve([{ json: {} }]) }, 5000);
    })

name: Config URL
type: n8n-nodes-base.function
parameters: functionCode: 
let next = 'https://api.hubapi.com/crm/v3/objects/contacts'

if (items[0].json.next) {
  next = items[0].json.next
}

return [
  {
    json: {
      next : next
    }
  }
]
name: Check if pagination?
type: n8n-nodes-base.if
parameters: conditions: boolean: value1: ={{$node["HTTP Request"].json["paging"] ? true : false}}
value2: yes
name: Set next URL
type: n8n-nodes-base.set
parameters: values: string: name: next
value: ={{$node["HTTP Request"].json["paging"]["next"]["link"]}}
keepOnlySet: yes
executeOnce: yes
name: Combine all data
type: n8n-nodes-base.function
parameters: functionCode: const allData = []

let counter = 0;
do {
  try {
    const items = $items("HTTP Request", 0, counter).map(item => item.json.results);
                    
    const aja = items[0].map(item => {
      return { json: item }
    })    
    
    allData.push.apply(allData, aja);
    //allData.push($items("Increment", 0, counter));
  } catch (error) {
    return allData;  
  }

  counter++;
} while(true);



Connections:
NoOp: main: node: Wait
type: main
Wait: main: node: Check if pagination?
type: main
Config URL: main: node: HTTP Request
type: main
HTTP Request: main: node: NoOp
type: main
Set next URL: main: node: Config URL
type: main
Check if pagination?: main: node: Set next URL
type: main
node: Combine all data
type: main
On clicking 'execute': main: node: Config URL
type: main