Giter Site home page Giter Site logo

twitch2slack's Introduction

twitch2slack

twitchq is used to notify a Slack-channel when a Twitch channel go online/offline. Polls Twitch API every 60s. Comes in 2 flavors: Service and one-time-run.

##twitchq_service.py: Service is just a while loop which does stuff and then sleep for 60s.

Pros:

  • Can be run in the background.
  • Logs to log file for error handling.
  • Runs in memory.

Cons:

  • Some kind of process overwatch is required in case it crashes.
  • Runs in memory. Stream status is lost if script crash.
  • Untested for any memory leaks.

##twitchq_otr.py: OTR run once and then exits.

Pros:

  • Can be run on demand.
  • Persistent storage on stream status.

Cons:

  • Use disk writes to save stream status.
  • Task scheduling required if automatic notifies is wanted.
  • No logging (yet).

Requirements

Installing

  1. Install Python 3 and pip.

  2. Install following Python 3 modules (pip install):

    • dateutil
    • pytz
    • requests
  3. Make sure twitchchannelquery module is in the same dir as twitchq.

  4. Run twitchq (flavor of your choice) to generate the file 'config.json'. Exit script (if running service) and modify this file with your own settings.

  5. Choose twitchq flavor.

    • OTR: Setup a cron job to run at regular intervals.
    • Service: Configure some kind of process overwatch to restart script just in case it dies.

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.