Create RSS/Atom feed for Telegram channel

⚠️ Warning! This code was made a long time ago, lots of API changes happened since then, making some parts of this code useless. For example, bots can already read messages in channels.

Update 16 May 2019: It seems that Telegram now allows to read public channels in browser (https://t.me/tgbeta/3618) even without Telegram account. So this repo now goes read-only and just for historical purposes. So long and thanks for all the fish!

This code allows you to form an RSS feed when you post messages to channel via bot. It works fine for me, but there can be some bugs.
In theory, devs can use this to form RSS/Atom feed for their channels to make content available outside Telegram.

Prerequisites

Installation

To install feedgen you need 1024+ megabytes of RAM, also you need to install some libs first:

sudo apt-get install sqlite3 libxml2 libxml2-dev libxslt1.1 libxslt1.1-dev  
pip3 install feedgen pytz pytelegrambotapi cherrypy  
sqlite3 storage.db < create_db.sql
  1. Rename config_example.py to config.py (Important)
  2. Fill in the necessary fields in config.py file
  3. Launch bot using webhooks with self-signed certificate (sample_custom_post.py) or check sample auto-posting bot (sample_hourly.py)

Check that your bot is set as admin in your channel!
If using custom poster, open chat with your bot and write a message to it. You should see that message in both channel and RSS/Atom feed.

Notes and restrictions

Any questions?

The code provided here should be self-explanatory, but in case you get stuck somewhere, feel free to e-mail me: groosha @ protonmail.com (remove extra spaces)