A service that converts a bunch of RSS feeds into a Telegram channel.
Overview
- Uses JSON as a source of RSS feeds (you can put it on GitHub Gist)
- Uses JSON on GitHub Gist as a storage for the state (just for fun C:)
- Publishes posts from those RSS feeds to a Telegram channel
Quick start
1. Create your feeds source
- Create a JSON file with the following structure and put it somewhere:
{
"feeds": [
"https://blog.github.com/all.atom",
"https://github.blog/engineering.atom",
"http://www.reddit.com/r/golang/.rss"
]
}
- If you want your bot to see new RSS feeds without restart, make sure your link always points to the latest version of the file (e.g.
https://gist.githubusercontent.com/rozag/dcd1b09bbe12a942dbe0f3bcbb2ace7b/raw/feeds-tech.json
). See instructions for GitHub Gist here
2. Create GitHub Gist storage JSON and token
- Create a new private GitHub Gist with the following content:
{}
. Remember the .json
file name and the Gist id (you can find it in the URL)
- Create a GitHub token with
gist
scope. Remember the generated token
3. Create Telegram bot and channel
- Create a Telegram channel. Remember it's id (e.g. @my_channel)
- Ask BotFather to create a new bot for you. Remember your bot token
- Add your new bot to administrators of your new channel
4. Build and deploy the container
- BTW you can simply run the app with
go run .
- Clone this repo
git clone https://github.com/rozag/rss-tg-chan.git
cd rss-tg-chan
- Put all your ids and tokens to the
config.ini
file like this:
source=LINK_TO_YOUR_SOURCES_JSON
githubToken=YOUR_GITHUB_TOKEN_WITH_GIST_SCOPE
githubGistID=YOUR_STORAGE_JSON_GIST_ID
githubGistFileName=YOUR_STORAGE_JSON_GIST_FILE_NAME
tgToken=YOUR_TELEGRAM_BOT_TOKEN
tgChannel=@YOUR_TELEGRAM_CHANNEL_ID
- Build docker image:
docker build --rm --tag YOUR_IMAGE_NAME:YOUR_IMAGE_TAG .
- Run your container locally
docker run YOUR_IMAGE_NAME:YOUR_IMAGE_TAG
or use docker save
, scp
and docker load
to transfer it to some remote host
Contributing
If you find a bug - create an issue. It's your contribution. And PRs are always welcome.
License
This project is licensed under the MIT License - see the LICENSE file for details.