Forwarding Messages from Any Public Telegram Channel to RSS and Email

 I’m subscribed to several (more than 10) Telegram channels. Some I check quite frequently, while others I only review twice a day (morning and after work). Because of this, I’d like to receive a “summary” of all messages to get an idea of the content and determine whether it’s worth reading everything.

RSS feed would be perfect for this, but... Telegram doesn’t offer an out-of-the-box integration for arbitrary Telegram channels (i.e., channels where you don’t have administrative access) with RSS or other information exchange tools (primarily email).

There are plenty of solutions based on Telegram bots, but all of them require admin access to the channel. The next option was to use a server built with MadelineProto and modify the source code to generate an RSS feed whenever a new message appears in a Telegram channel. This idea was rejected due to the reluctance to modify PHP code and maintain a server.

An internet search yielded several paid solutions like rss.app, which allows you to generate RSS feeds from Telegram channels. However, I wasn’t keen on paying $10 a month for an update frequency of every 4–8 hours.

I also found free RSS solutions such as rss-bridge.org and rsshub.app. These services work by inputting the name of the Telegram channel, and they generate the URL for an RSS feed.

Their main drawback is the long interval for feed updates—6–8 hours. This is acceptable for my wife (no problem archiving messages once a day from her channels), but for me (news channels), more frequent updates are preferable.

Since rss-bridge.org is an open-source solution, I decided to use it.

I purchased a VPS for €2.50 (Ubuntu 22.04) and started installing rss-bridge following the instructions here: https://github.com/RSS-Bridge/rss-bridge.

For some unknown reason, direct installation on the server didn’t yield the desired results: the instructions seemed to lack a part responsible for integration with Nginx. Even ChatGPT couldn’t help.

However, installation via Docker worked:

sudo apt-get purge -y docker-engine docker docker.io docker-ce docker-ce-cli docker-compose-plugin
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" |   sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
docker create --name=rss-bridge --publish 3000:80 --volume $(pwd)/config:/config rssbridge/rss-bridge
sudo docker create --name=rss-bridge --publish 3000:80 --volume $(pwd)/config:/config rssbridge/rss-bridge
sudo docker start rss-bridge

Now, when accessing http://<myprivatevpsserver.com>:3000, it displays an interface similar to the public instance at https://rss-bridge.org/bridge01/, but with a feed update interval of 30 minutes instead of 4–8 hours.

The RSS feed looks like this:

http://<myprиvatevpsserver.tld>:3000/?action=display&bridge=TelegramBridge&username=%40ChannelName&format=Atom

The first part of the problem (RSS) is solved, and now the second part (integration with email) remains to be addressed.

This turned out to be simpler. Installation instructions, configuration, and the package itself can be found here: https://github.com/rss2email/rss2email.

sudo apt install rss2email
# config file located at cd ~/.config/rss2email.cfg
#setup target email address
r2e new myprivateemail@domain.tld
#setup feed for Wall Street Journal
r2e add WSJ https://feeds.a.dj.com/rss/RSSWorldNews.xml
#setup feed for Telegram channel generated by my rss-bridge instance
r2e add TelegramChannelFeedName "http://<myprиvatevpsserver.tld>:3000/?action=display&bridge=TelegramBridge&username=%40ChannelName&format=Atom"

Config SMTP Server in  ~/.config/rss2email.cfg

[DEFAULT]
from = myprivateemail@domain.tld
......
email-protocol = smtp
.....
html-mail = True
.....
smtp-auth = True
smtp-username = myprivateemail@domain.tld
smtp-password = password_for_myprivateemail@domain.tld
smtp-server = smtp.domain.tld
smtp-port = 465
smtp-ssl = True
.............

Add the following line into crontab:

0 * * * * r2e run
Once an hour, all messages from the feeds generated by my instance of RSS-Bridge, as well as any other feeds added to the RSS2Email configuration, are forwarded to my email myprivateemail@domain.tld.


Comments

Popular posts from this blog

IMAP, POP and SMTP settings of email providers for legacy email clients without OAUTH2 support

Workaround for synchronization error of Microsoft hotmail.com/outlook.com account on W10M Lumia

Настройки IMAP, POP and SMTP для устаревших email клиентов без поддержки OAUTH2