This bot read posts from an RSS source and sends them to a Telegram channel. It uses an SQLite database to save the sent posts.
In config
folder you will find two files:
database.yml
: Database configurationconfig.yml
: Bot configuration. This file is in the.gitignore
. You can follow theconfig.yml.sample
to create it.
Field name | Description |
---|---|
bot_token | Bot's token. You can get it asking to @BotFather |
channel_id | Channel ID. If the channel is public the ID is the @name. If the channel is private you can use the JsonDumpBot to get the ID. |
rss_feed_url | URL of the RSS feed (where you want to read the news). |
- Run
ruby bin/migrate.rb
to create and update the database. - Run
ruby bin/console.rb
to start a console. - Run
ruby bin/rss_sender.rb
to check and send the last news from the RSS source to the Telegram channel. You can add this command tocrontab
to automatically send the last news.
# Install gems
bundle install
# Run migrations
ruby bin/migrate.rb
# Run bot
./scripts/start_rss_sender
# Create a tag version
git tag -a version-YYYYMMDD-vX.Y -m 'Version X.Y'
# Push tags
git push origin --tags
- Review the code structure
- Improve log