~nickbp/twitch-rss

Follow Twitch accounts over RSS using this as a proxy

268359a curl should be in runtime, not builder

a month ago

458fafc Bump deps, add curl to docker image

a month ago

#Twitch-RSS

builds.sr.ht status

Generates RSS feeds for Twitch accounts.

This acts as a proxy to Twitch, presenting video history as an RSS feed. The idea is that you can add specific accounts to your RSS reader as separate URLs/feeds.

You can run it in two modes:

  • HTTP: A caching proxy to Twitch, presenting an HTTP endpoint that can be added to RSS readers
  • CLI: Manual polling (without caching), the resulting feed can be published to a static site.

#Quickstart

In order to use this, you first need to create a Twitch App and get the Client ID and Client Secret. Those credentials will then be used by twitch-rss to query Twitch APIs.

To install twitch-rss, you can run cargo install twitch-rss. Docker images for amd64/arm64 are also available, see the Dockerfile.

#HTTP

  1. Prerequisites: Get your Twitch App credentials, and install twitch-rss using cargo install twitch-rss.
  2. Start twitch-rss with CLIENT_ID and CLIENT_SECRET envvars containing the Twitch App credentials. You can optionally also specify LISTEN, 0.0.0.0:8080 is the default:
    $ CLIENT_ID=1234...abcd \
        CLIENT_SECRET=5678...efgh \
        LISTEN=127.0.0.1:8080 \
        ./twitch-rss
    
  3. Once twitch-rss is running, you can then add it to your RSS reader with /rss?account=ACCOUNT_NAME_HERE added to the end of the LISTEN address. You can test this manually with curl:
    $ curl -v 'http://127.0.0.1:8080/rss?account=ACCOUNT_NAME_HERE'
    

#CLI/stdout

You can also run twitch-rss via the command line with the account to query as an argument. The command will then write the RSS payload to stdout. This is mainly useful for testing, or for writing the RSS payload to a static file.

$ CLIENT_ID=1234...abcd \
    CLIENT_SECRET=5678...efgh \
    ./twitch-rss ACCOUNT_NAME_HERE

#Options

twitch-rss mainly exposes options via environment variables. The one exception is specifying an account name to fetch as an argument, as shown in the CLI/stdout example above.

  • CLIENT_ID/CLIENT_SECRET: Your Twitch App credentials for querying the Twitch API. Required.
  • LOG_LEVEL: Amount of logging you'd like to have. Defaults to info, can be set to debug/trace to get more logs or warn/error/off to get fewer logs.

HTTP-specific options:

  • LISTEN: The listen address when running in HTTP mode. Defaults to 0.0.0.0:8080 (port 8080 on all interfaces).
  • USER_CACHE_SECS: The duration in seconds to cache information about Twitch accounts. Default is 86400 or 1 day.
  • VIDEO_CACHE_SECS: The duration in seconds to cache the recent videos for a given Twitch account. Default is 600 = 10 minutes)

#License

This project is licensed under the FAFOL. This is intended to restrict use of the project for purposes that would be considered unethical by its authors.