Skip to content

Instantly share code, notes, and snippets.

@alexanderschau
Last active January 10, 2021 19:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alexanderschau/39192f90d99d82704a17420eca3105e2 to your computer and use it in GitHub Desktop.
Save alexanderschau/39192f90d99d82704a17420eca3105e2 to your computer and use it in GitHub Desktop.
{
"name": "COVID",
"nodes": [
{
"parameters": {},
"name": "Start",
"type": "n8n-nodes-base.start",
"typeVersion": 1,
"position": [
400,
400
]
},
{
"parameters": {
"functionCode": "\nconst date = new Date(new Date().setDate(new Date().getDate() - 1)).toISOString().split(\"T\")[0].split(\"-\");\nitem.date = `${date[1]}-${date[2]}-${date[0]}`;\nreturn item;"
},
"name": "Get Date",
"type": "n8n-nodes-base.functionItem",
"typeVersion": 1,
"position": [
600,
400
]
},
{
"parameters": {
"url": "=https://raw.githubusercontent.com/CSSEGISandData/COVID-19/master/csse_covid_19_data/csse_covid_19_daily_reports/{{$json[\"date\"]}}.csv",
"responseFormat": "file",
"options": {},
"headerParametersUi": {
"parameter": []
},
"queryParametersUi": {
"parameter": []
}
},
"name": "Fetch Script",
"type": "n8n-nodes-base.httpRequest",
"typeVersion": 1,
"position": [
800,
400
]
},
{
"parameters": {
"options": {}
},
"name": "Convert 2 JSON",
"type": "n8n-nodes-base.spreadsheetFile",
"typeVersion": 1,
"position": [
1000,
500
]
},
{
"parameters": {
"functionCode": "items[0].json.myVariable = 1;\nreturn items.filter(item => item.json.Combined_Key == \"Berlin, Germany\");"
},
"name": "Filter region",
"type": "n8n-nodes-base.function",
"typeVersion": 1,
"position": [
1200,
500
]
},
{
"parameters": {
"options": {}
},
"name": "Send Email",
"type": "n8n-nodes-base.emailSend",
"typeVersion": 1,
"position": [
1400,
500
]
}
],
"connections": {
"Get Date": {
"main": [
[
{
"node": "Fetch Script",
"type": "main",
"index": 0
}
]
]
},
"Fetch Script": {
"main": [
[
{
"node": "Convert 2 JSON",
"type": "main",
"index": 0
}
]
]
},
"Convert 2 JSON": {
"main": [
[
{
"node": "Filter region",
"type": "main",
"index": 0
}
]
]
},
"Start": {
"main": [
[
{
"node": "Get Date",
"type": "main",
"index": 0
}
]
]
},
"Filter region": {
"main": [
[
{
"node": "Send Email",
"type": "main",
"index": 0
}
]
]
}
},
"active": false,
"settings": {
"timezone": "Europe/London",
"executionTimeout": -1
},
"id": "9"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment