Coder Social home page Coder Social logo

twitch-watch-tower-ranny's Introduction

Twitch Streamer Live Checker

This script checks if specified Twitch streamers are live and opens their streams in a web browser when they go live. It also periodically prompts the user if they want to reopen any previously watched streams.

Prerequisites

  • Python 3.x
  • requests library (install via pip install requests)

Setup

  1. Clone this repository or download the script.
  2. Replace your_client_id and your_client_secret in the script with your Twitch API credentials.

Usage

Run the script:

python twitch_live_checker.py

How It Works

  1. Authentication: The script uses your Twitch API credentials to obtain an OAuth token.
  2. Streamer Status Check: It checks if the specified streamers are live by querying the Twitch API.
  3. Alerts: When a streamer goes live, the script opens their stream in a web browser and plays a beep sound.
  4. Periodic Prompt: Every hour, the script prompts the user to ask if they want to reopen any previously watched streams.

Default Streamers

If no streamers are specified by the user, the script monitors the following default streamers:

  • theprimeagen
  • squishymuffinz
  • rocketleague
  • johnnyboi_i
  • rlesports
  • ranny

Custom Streamers

You can specify custom streamers by entering their usernames separated by commas within 15 seconds after running the script. If you don't provide any input, the script will use the default list of streamers.

Script Details

get_app_access_token(client_id, client_secret)

Fetches an OAuth token from Twitch.

is_live(username, access_token)

Checks if a specific streamer is live on Twitch.

input_with_timeout(timeout=15)

Prompts the user to input streamer names within a specified timeout period.

prompt_for_input(queue, prompt, timeout=15)

Prompts the user for input with a timeout.

prompt_reopen(queue)

Periodically prompts the user if they want to reopen previously watched streams.

main()

Main function that initializes the script, monitors streamers, and handles user prompts.

Example

python twitch_live_checker.py

You will be prompted to enter streamer names separated by commas. If no input is provided within 15 seconds, the script will use the default list of streamers.

Contributing

Feel free to submit issues or pull requests for improvements or additional features.

twitch-watch-tower-ranny's People

Contributors

frankmormino avatar

Watchers

 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.