Giter VIP home page Giter VIP logo

ticker's Introduction

Ticker Codacy Badge

A Python HTTP/JSON script to display the score of today's NHL hockey games. When run in persistent mode, information is downloaded directly from the NHL website every 20 seconds.

Requirements

  • Linux machine (not yet Windows compatible)

  • Python 3.6+

    • python3 --version

Additional requirements can be installed with pip - there is a requirements.txt file provided that allows you to simply run pip3 install -r requirements.txt. Included in this file are the following packages:

Usage

usage: ./ticker.py [-h] [-p]

optional arguments:
  -h, --help     show this help message and exit
  -p, --persist  live-update scores on persistent scoreboard

Once you've installed the requirements (pip3 install -r requirements.txt), permit the script to execute:

chmod u+x ticker.py

Then run the script:

./ticker.py

This will run the script once, simply outputting the current scores.

If you wish to run the script persistently and have the scores auto-update every 20 seconds, add the --persist flag:

./ticker.py -p

To quit, press Q. Alternatively, Ctrl-C works as well (but try to avoid this if you can).

IMPORTANT: All game times are displayed in PST.

Data Source

License

Copyright 2019 Greg Hennis, Stevie Howard.

MIT License

ticker's People

Contributors

codacy-badger avatar gitter-badger avatar jtf323 avatar scaryghosty avatar stvhwrd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ticker's Issues

Bug: game clock always shows "TODAY"

Game clock shows only TODAY regardless of time left in period, etc.

This is definitely due to normalize_today() method:

    def normalize_today(self):
        date = get_date(0)
        if date.upper() in self.game_clock or \
            'TODAY' in self.game_clock or \
            'LIVE' in self.game_status or \
            'PROGRESS' in self.game_status:
            self.game_clock = 'TODAY'
        return

No clean exit

There should be a "press Q to quit" or similar. Ctrl C is a pretty ugly way to exit.

Good use case for threaded polling, perhaps..

Internet disconnected causes crash

Script crashes when the internet is disconnected, even without live games in play. Scoreboard should remain static while without internet and continue to attempt refreshes at 30s intervals.

Intermission clock is unreliable and has no sync with actual time

The intermission clock is a simple countdown timer that runs for the length of each intermission - 18 minutes for first and second, 15 minutes for following intermissions.

This is only accurate when script runs uninterrupted and is guaranteed to have started running before the first intermission.

Official intermission clock is not available outside the arena. Need to find a robust fix, but a band-aid is to offer no intermission clock unless the script witnessed the end of the period.

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.