Skip to content

News relay from mmcs website to a telegram channel

License

Notifications You must be signed in to change notification settings

xamgore/mmcs-news-scraper

Repository files navigation

mmcs news scraper

This project is used to automatically take news from the faculty's website and send them to Telegram's chat room #mmcsfamily.

How it works

The algorithm is simple:

This sequence is reflected in the src/app.js file:

grabRSS(FEED_URL)
  .then(extractPosts)
  .then(skipExisting)
  .then(ps => console.log(`New posts: ${ps.length}`) || ps)
  .then(sendToChat)
  .then(savePosts)

How to build

There is the .env.example file in the project root. Rename it to .env, change variables inside, then download all dependencies by npm i, and run the app with npm start command.

To add a task to cron run crontab -e, then add the line:

*/30 * * * *   cd /root/mmcs-news-scraper/ && /root/.nvm/versions/node/v13.11.0/bin/node -r ./register.js ./src/index.js

About

News relay from mmcs website to a telegram channel

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published