Skip to content

Latest commit

 

History

History
55 lines (44 loc) · 5.15 KB

README.md

File metadata and controls

55 lines (44 loc) · 5.15 KB

Howzat

Howzat is a Python script to show Windows 10 toast notifications for live cricket scores. As of now, the script supports only the Windows 10 platform. Further updates to make it Linux compatible will be added soon. You can get toast notifications whenever a four or six is hit, wicket is taken or at the end of an over which can be customized as per the user's needs.

Demo video of the script : https://drive.google.com/open?id=11JH25moj6pen4UwQSc_XKZQICzpzR5iB

four         six

wicket       over

Working

First of all, you'll be needing Chromedriver.
Download Chromedriver from here : http://chromedriver.chromium.org/downloads.
After downloading Chromedriver, unzip the file and copy the path of 'chromedriver.exe' in line 38 of 'Howzat.py'. image

All set and done, now you'll only need to provide the user input for the script.

The most important parameter of the input is the URL of the match, which is basically the URL of the commentary section of the match on Cricbuzz. For eg., for the current India vs West Indies test match, the URL can be found as follows.

  1. Head over to https://www.cricbuzz.com/cricket-match/live-scores.
  2. On the top part of the page, you'll be able to find a list of matches like this.

    image

  3. Click on the match for which you want the scores. Eg., here we click on 'IND vs WI - Live'.

    image

  4. After this, we get a page something like this.

    image

  5. The URL of this page is our required input.

    image

  6. Paste this URL in line 14 of 'Howzat.py'.

    image

NOTE : Obviously this is not the only method to get our URL, but keep in mind to always use the URL of the 'Commentary' section, not of 'Scorecard' or 'Full Commentary' or any other sections, because getting the URL correct is the most important part.

image

After getting the URL, we need to enter the following inputs :

  1. time_interval : In seconds. It is basically the amount of time after which the script will crawl the page again to fetch the latest scores. Keeping it at a low value will lead to faster score updates and keeping it at a higer value will lead to delayed score updates. However, it is advised to keep it at a value >= 10. Recommended : 15.

    Now, for the next 5 inputs, we only need to specify either a 'Y' or 'N'.

  2. show_match_status : Match status is whatever appears in red on the scores page.

    image

    Since the primary notification did not have enogh space to show the match status, it appears as a second notification just after the primary one.

    screenshot_1

  3. show_fours : Whether you want the notifications after a four is hit.

  4. show_sixes : Whether you want the notifications after a six is hit.

  5. show_wickets : Whether you want the notifications after the fall of a wicket.

  6. show_EndOfOver : Whether you want the notifications after the end of an over.

SAMPLE USER INPUT

image

NOTE : You can also set the icon which appears along with the notifications. For the cricket icon, download 'Cricket.ico' from this repository and copy it in the same path as the script. For your own custom icons, download a .ico file from the internet and set it's path in the 'toaster.show_toast()' in lines 119, 123, 143 and 147 of 'Howzat.py' under the argument 'icon_path'.

image

That's it. You can cheer for your favourite team now!! :)