Generates a rss/atom feed notifying you when Twitch streamers you follow go live. It can be used with flask or with static xml files which you can serve however you like. The feed includes which game is being played and a stream preview. It uses the 'New Twitch API' aka 'Helix'.
- Go to twitch console
- Choose a Name
- Set OAuth Redirect URLs to
http://localhost
- Choose a Category
- Note your
Client ID
andClient Secret
$ ./scripts/obtain_oauth2.sh YOUR_CLIENT_ID YOUR_CLIENT_SECRET
Create and edit your config with the previously obtained parameters
$ cp -vi .config.preset.cfg config.cfg
$ vim config.cfg
$ python -m venv env && source env/bin/activate # optional
$ pip install -r requirements.txt
Python version: 3.7.3
Run using flasks built in server. This is not suitable for production.
$ flask run --host=HOST_IP --port=5000
Generate atom/rss files
$ mkdir -p /srv/http
$ python genfeed.py
You can easily add a cronjob on your server to update the feed.
ft
is an optional argument to your request and can either be atom
or rss
(default is rss
)
To get a feed with all followed channels
$ curl 'http://HOST_IP:5000/feed'
$ curl 'http://HOST_IP:5000/feed?ft=atom'
To get a feed from a single channel
$ curl 'http://HOST_IP:5000/feed/esl_csgo?ft=atom'