Giter Club home page Giter Club logo

reddit-twitch-bot's Introduction

Reddit Twitch Bot

A Reddit bot which polls Twitch.tv streams and updates a subreddit's sidebar with their current statuses.

Usage

  1. Have Python (v2 or v3) installed, along with the following libraries: 0. Requests

    1. PRAW
    2. configparser
  2. Register your bot with Twitch at http://www.twitch.tv/kraken/oauth2/clients/new

  3. Create a Reddit account for the bot, and make it a mod on the subreddit you want it to work on.

  4. Clone this repository.

  5. Copy config.sample.conf to config.conf.

  6. Open up config.conf and fill in the required fields.

  7. Add the following code snippet in your subreddit's sidebar where you want the stream list to be printed.

    [](#BOT_STREAMS)[](/BOT_STREAMS)
    

    These are empty links, so they won't show up on the page, but the bot will be able to see them and add text between them.

  8. Run the bot as ./twitchbot. It will use a configuration file named config.conf by default, or you can run it as ./twitchbot other_config.conf to use

  9. (Optional) Setup a crontab (or equivalent) to run the script as often as you want.

Templating

This bot outputs stream information according to a user specified format. The template value is printed for each active stream, with the following substitutions made:

These values: Will be replaced with this data:
$name The channel name
$viewers The number of active viewers
$title The current title of the stream
$link The URL of the stream
$icon The URL of the streamer's 300x300 icon
$banner The URL of the streamer's banner

Also, all Python escape sequences are supported in template, header, footer, separator, and no_streams.

Code Style

All code is PEP8 compliant.

reddit-twitch-bot's People

Contributors

gpittarelli avatar vibdev avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.