The script scrapes RSS feeds (every 1 second, rotational) and shares it to Telegram or Twitter. It is intended to be used for live news but should support other similarly structured RSS feeds.
Telegram: @SGLiveNews
- Save
config.yml.example
asconfig.yml
. - Obtain twitter keys from Twitter Developer API Dashboard.
- Obtain telegram keys from Botfather.
- Create a telegram channel or group chat and obtain the chat_id. If your telegram channel is public, setting the
chat_id
as@linkname
will work as well. - Obtain a discord channel and obtain the webhook URL.
- Find an RSS Feed (e.g. Straits Times Singapore).
- Obtain root url (e.g. https://www.straitstimes.com/news/{feed}/rss.xml), {feed} is a template variable that will be filled in by the script.
- Fill in the various categories that you wish to scrape.
- You may include as many feeds as desired. The more feeds, the longer a cycle will take.
- You may disable specific services (twitter/telegram/discord) in the config file.
- Python 3.6+ is required.
pip install -r requirements.txt
python main.py
- Twitter has a tendency to "ghostban" the account due to excessive link posting with similar message structure. Manual phone verification is needed every few hours.
- Support for Telegram Instant View would be great.