Security News
Weekly Downloads Now Available in npm Package Search Results
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
rss-to-telegram
Advanced tools
This is the module that you need to send rss news to a telegram channel.
This is the module that you need to send rss news to a telegram channel.
support for:
npm i rss-to-telegram
const rssToTelegram = require("rss-to-telegram");
const { TELEGRAM_BOT, TELEGRAM_CHANNEL } = process.env;
rssToTelegram({
bot: TELEGRAM_BOT,
channel: TELEGRAM_CHANNEL,
cron: "*/15 * * * * *", // publish every 15 seconds, cron sintaxis
timezone: "America/Havana", // your defined timezone
// rss source
source: "https://feed.informer.com/digests/ZO8A5LZCGA/feeder.rss", // can be an async function or and array of objects
// source: async () => {
// return db.get({ limit: 10 }); // your custom db
// },
// source: [{colo:"red"}],
// add new fields to show in the message
preprocess: async (item) => {
item.color = "green";
return item;
},
// define you own message template
template:
'Color is {{color}}, <a href="{{image}}"> </a> <b><a href="{{link}}">{{title}}</a></b>\n @{{channel}}',
// filter news of the day, use this function to filter already published posts
filter: async ({ date }) => { // async functtion
// must be async
const d = new Date();
return (
date.getDate() === d.getDate() &&
date.getMonth() === d.getMonth() &&
date.getFullYear() === d.getFullYear()
);
},
// add extra common fields to all items,
extraFields: { colo: "red", line: "stroke" }, // add line field to all items and overwrite color field
});
# ┌────────────── second (optional)
# │ ┌──────────── minute
# │ │ ┌────────── hour
# │ │ │ ┌──────── day of month
# │ │ │ │ ┌────── month
# │ │ │ │ │ ┌──── day of week
# │ │ │ │ │ │
# │ │ │ │ │ │
# * * * * * *
0 */5 * * * *
0 */15 * * * *
0 30 * * * *
0 0,5,10 * * * *
0 */30 * * * *
More example https://crontab.guru/examples.html
https://github.com/moment/moment-timezone/blob/develop/data/packed/latest.json
use the preprocess function to add fields, then modify the template to show the new fields in the message
rssToTelegram({
...
preprocess: async (item) => {
item.color = "green";
return item;
},
template: 'Color is {{color}}, Link is {{link}}, Title is {{title}} \n @{{channel}}',
...
})
Donate Bitcoin:
bitcoin:3GqQcxFk5y7onUyoTKqZHwoWXvLusqJSVG
3GqQcxFk5y7onUyoTKqZHwoWXvLusqJSVG
Contact: fabiel.leon.oliva@gmail.com
FAQs
This is the module that you need to send rss news to a telegram channel.
We found that rss-to-telegram demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.
Security News
A Stanford study reveals 9.5% of engineers contribute almost nothing, costing tech $90B annually, with remote work fueling the rise of "ghost engineers."
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.