https://github.com/jchristgit/twitchup
Add Twitch streamers statuses to your subreddit's sidebar.
https://github.com/jchristgit/twitchup
Last synced: 11 months ago
JSON representation
Add Twitch streamers statuses to your subreddit's sidebar.
- Host: GitHub
- URL: https://github.com/jchristgit/twitchup
- Owner: jchristgit
- License: isc
- Created: 2018-05-09T18:12:43.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-11-01T01:38:41.000Z (over 1 year ago)
- Last Synced: 2025-03-26T18:55:08.937Z (about 1 year ago)
- Language: Python
- Size: 75.2 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# twitchup
`twitchup` adds Twitch stream status indicators for subreddit sidebars. It
works by polling stream information from Twitch's API and then updating a given
sidebar template.
## Setup
Set the following environment variables:
- `REDDIT_CLIENT_ID`: your reddit bot client ID
- `REDDIT_CLIENT_SECRET`: your reddit bot client secret
- `REDDIT_USERNAME` and `REDDIT_PASSWORD` for the bot account
- `TWITCH_CLIENT_ID`: your twitch app client ID (get it
[here](https://dev.twitch.tv/dashboard/apps))
- `OWNER_NAME`: the name of the bot's owner on reddit, without the leading `/u/`
part.
You can get the reddit credentials [here](https://www.reddit.com/prefs/apps/).
Make sure to add the bot as a moderator on the specific subreddit.
Install dependencies: `pip3 install -r requirements.txt`. Or `apt install
python3-praw` on a Debian-based system.
## Usage
Create a directory named `templates` (or any place of your liking, as specified
by the `--template-directory` switch) and create subdirectories named after the
desired subreddits in there. To template a custom or text area widget with the
title "Streams", create a file named `widget.md` in said subdirectory. For
templating the old-style sidebar, create a file named `sidebar.md` instead. You
can also create both files. Use `twitchup()` where you want stream
information to be placed. `twitchup` generates the following:
For an online stream, `twitchup(name)` becomes:
```md
[name](https://twitch.tv/name 'twitch-online')
```
and for an offline stream, `twitchup(name)` becomes:
```md
[name](https://twitch.tv/name 'twitch-offline')
```
You can then apply custom styles in your subreddit's stylesheet.
To run the script, simply use `python3 twitchup.py`.
## Disclaimer
`twitchup` is not affiliated nor endorsed by Twitch or Reddit.
## Credits
`twitchup` is inspired by [`twitchit`](https://github.com/jensechu/twitchit).