n8n
Workflow
Get Data From Hacker News And Send To Airtable Or Via Sms
This n8n workflow automates tasks using Airtable. Get Data From Hacker News And Send To Airtable Or Via Sms - ready to import and run in your n8n instance.
n8n
workflow.json
About This Script
This n8n workflow automates tasks using Airtable. Get Data From Hacker News And Send To Airtable Or Via Sms - ready to import and run in your n8n instance.
Features:
- Scheduled automation with cron triggers
- Custom JavaScript function processing
- Integrates with Airtable
- Sends notifications or updates
- Retrieves data from external sources
Source Code
{
"nodes": [
{
"name": "Daily trigger",
"type": "n8n-nodes-base.cron",
"position": [
620,
750
],
"parameters": {
"triggerTimes": {
"item": [
{
"hour": 8
}
]
}
},
"typeVersion": 1,
"id": "7d2647b6-fd97-4296-a004-d21fdda37a17"
},
{
"name": "Get top 3 articles",
"type": "n8n-nodes-base.hackerNews",
"position": [
820,
750
],
"parameters": {
"limit": 3,
"resource": "all",
"additionalFields": {
"tags": [
"front_page"
]
}
},
"typeVersion": 1,
"id": "fee8f4b1-7fbc-4f51-ab4c-5a5426dc8772"
},
{
"name": "Extract words",
"type": "n8n-nodes-base.function",
"position": [
1020,
750
],
"parameters": {
"functionCode": "const words = [];\nconst regex = /\\d/g;\nconst newItems = [];\n\n// Splits titles into words and removes numbers\n// using regular expressions\n\nfor(let i=0; i < items.length; i++) {\n let split_titles = []; \n split_titles = items[i].json.title.split(' ');\n for(let j=0; j < split_titles.length; j++) {\n if(regex.test(split_titles[j])) {\n continue;\n } else {\n words.push(split_titles[j]);\n }\n }\n}\n\n// Removes all duplicate words by converting the\n// array into a set and then back into an array\n\nconst uniqueWords = [...new Set(words)];\n\n// Transform the array to the data structure expected\n// by n8n\n\nfor(let k=0; k < uniqueWords.length; k++) {\n newItems.push({json: { words: uniqueWords[k] }});\n}\n\nreturn newItems;"
},
"typeVersion": 1,
"id": "78578aea-10f3-41c9-82b6-e89cabad5c9c"
},
{
"name": "Translate",
"type": "n8n-nodes-base.lingvaNex",
"position": [
1220,
750
],
"parameters": {
"text": "={{$node[\"Extract words\"].json[\"words\"]}}",
"options": [],
"translateTo": "de_DE"
},
"credentials": {
"lingvaNexApi": "LingvaNex"
},
"typeVersion": 1,
"id": "cfd82bc9-514b-4540-801f-93c546508fe7"
},
{
"name": "Filter data ",
"type": "n8n-nodes-base.set",
"position": [
1420,
750
],
"parameters": {
"values": {
"string": [
{
"name": "English word",
"value": "={{$node[\"Translate\"].json[\"source\"]}}"
},
{
"name": "Translated word",
"value": "={{$node[\"Translate\"].json[\"result\"]}}"
}
]
},
"options": [],
"keepOnlySet": true
},
"typeVersion": 1,
"id": "54e7eab0-c635-4a7f-8ace-99032c80b466"
},
{
"name": "Save today's words",
"type": "n8n-nodes-base.airtable",
"position": [
1620,
850
],
"parameters": {
"table": "Table 1",
"options": [],
"operation": "append",
"application": "app4Y6qcCHIO1cYNB"
},
"credentials": {
"airtableApi": "Airtable"
},
"typeVersion": 1,
"id": "e8d9213b-d9a9-4349-b736-f21a4e17eb66"
},
{
"name": "Craft message",
"type": "n8n-nodes-base.function",
"position": [
1620,
650
],
"parameters": {
"functionCode": "const number_of_words = 5;\nconst words = [];\n\n// Crafts the words to be sent in en_word : translated_word format\n// and adds them to an array\n\nfor(let i=0; i < number_of_words; i++) {\n words.push(items[i].json['English word'] + ' : ' + items[i].json['Translated word']);\n}\n\n// Takes all the items from the array and converts them into a comma\n// separated string\n\nconst words_of_the_day = words.join(', ');\n\nreturn [{json: {words_of_the_day: words_of_the_day}}];"
},
"typeVersion": 1,
"id": "31d61d42-09dd-4b9b-a685-1cc7b35bcd72"
},
{
"name": "Send SMS",
"type": "n8n-nodes-base.vonage",
"position": [
1820,
650
],
"parameters": {
"to": "+4915225152610",
"from": "Vonage APIs",
"message": "=Good morning, here are your words for today\n{{$node[\"Craft message\"].json[\"words_of_the_day\"]}}",
"additionalFields": []
},
"credentials": {
"vonageApi": "Vonage"
},
"typeVersion": 1,
"id": "d001d39c-b3ab-4b03-bff9-8110c5617fee"
}
],
"connections": {
"Translate": {
"main": [
[
{
"node": "Filter data ",
"type": "main",
"index": 0
}
]
]
},
"Filter data ": {
"main": [
[
{
"node": "Craft message",
"type": "main",
"index": 0
},
{
"node": "Save today's words",
"type": "main",
"index": 0
}
]
]
},
"Craft message": {
"main": [
[
{
"node": "Send SMS",
"type": "main",
"index": 0
}
]
]
},
"Daily trigger": {
"main": [
[
{
"node": "Get top 3 articles",
"type": "main",
"index": 0
}
]
]
},
"Extract words": {
"main": [
[
{
"node": "Translate",
"type": "main",
"index": 0
}
]
]
},
"Get top 3 articles": {
"main": [
[
{
"node": "Extract words",
"type": "main",
"index": 0
}
]
]
}
},
"n8n_version": "1.5.0"
}
Requirements
n8n instance, Airtable API credentials
Tags
#n8n
#automation
#workflow