Skip to content

Instantly share code, notes, and snippets.

@cameri
Created December 8, 2021 03:45
Show Gist options
  • Save cameri/5f39b3b742aea33feb827cb5d562e583 to your computer and use it in GitHub Desktop.
Save cameri/5f39b3b742aea33feb827cb5d562e583 to your computer and use it in GitHub Desktop.
[
{
"id": "5618e48f0abe4e10",
"type": "tab",
"label": "Stacker News",
"disabled": false,
"info": "",
"env": []
},
{
"id": "a0b2e4de5203e15f",
"type": "telegram sender",
"z": "5618e48f0abe4e10",
"name": "",
"bot": "e778190f764f5664",
"haserroroutput": true,
"outputs": 2,
"x": 400,
"y": 200,
"wires": [
[],
[]
]
},
{
"id": "3a93423430199d0f",
"type": "feedparse",
"z": "5618e48f0abe4e10",
"name": "Stacker News",
"url": "https://stacker.news/rss",
"interval": "5",
"x": 110,
"y": 100,
"wires": [
[
"e1dd5fa8ac9e3c78"
]
]
},
{
"id": "950f6488217d8ba0",
"type": "function",
"z": "5618e48f0abe4e10",
"name": "Convert To Telegram Message",
"func": "const title = msg.article.title.replace(/\\*/, '');\n\nconst article = msg.article.link !== msg.article.guid\n ? [`[Article](${msg.topic})`]\n : [];\nconst comments = [`[Comments](${msg.article.comments})`];\n\nconst links = [...article, ...comments].join(', ');\n\nconst content = [title, links].join('\\n');\n\nconst payload = {\n type: 'message',\n content,\n options: {\n parse_mode: 'Markdown',\n disable_web_page_preview : true,\n }\n};\n\nreturn { payload };",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 690,
"y": 100,
"wires": [
[
"c7f8646b867a7666"
]
]
},
{
"id": "c7f8646b867a7666",
"type": "change",
"z": "5618e48f0abe4e10",
"name": "Set Telegram Chat ID",
"rules": [
{
"t": "set",
"p": "payload.chatId",
"pt": "msg",
"to": "-1001773844602",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 160,
"y": 200,
"wires": [
[
"a0b2e4de5203e15f"
]
]
},
{
"id": "e1dd5fa8ac9e3c78",
"type": "Cache in",
"z": "5618e48f0abe4e10",
"name": "",
"cache": "bd1da02616dfd7d6",
"keyType": "msg",
"keyProperty": "topic",
"valueType": "msg",
"valueProperty": "cached",
"useString": false,
"outputs": 2,
"x": 270,
"y": 100,
"wires": [
[],
[
"71e13b06cebf149a",
"745d0cba44fe6326"
]
]
},
{
"id": "745d0cba44fe6326",
"type": "Cache out",
"z": "5618e48f0abe4e10",
"name": "",
"cache": "bd1da02616dfd7d6",
"keyType": "msg",
"keyProperty": "topic",
"valueType": "msg",
"valueProperty": "payload",
"ttlType": "msg",
"ttlProperty": "",
"useString": false,
"x": 430,
"y": 40,
"wires": []
},
{
"id": "71e13b06cebf149a",
"type": "delay",
"z": "5618e48f0abe4e10",
"name": "",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 450,
"y": 100,
"wires": [
[
"950f6488217d8ba0"
]
]
},
{
"id": "e778190f764f5664",
"type": "telegram bot",
"botname": "ADA",
"usernames": "",
"chatids": "",
"baseapiurl": "",
"updatemode": "none",
"pollinterval": "300",
"usesocks": false,
"sockshost": "",
"socksport": "6667",
"socksusername": "anonymous",
"sockspassword": "",
"bothost": "",
"botpath": "",
"localbotport": "8443",
"publicbotport": "8443",
"privatekey": "",
"certificate": "",
"useselfsignedcertificate": false,
"sslterminated": false,
"verboselogging": false,
"credentials": {}
},
{
"id": "bd1da02616dfd7d6",
"type": "Cache",
"name": "stacker-news",
"defaultTtl": "2629746",
"checkPeriod": ""
}
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment