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
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'.
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.
- Head over to https://www.cricbuzz.com/cricket-match/live-scores.
- On the top part of the page, you'll be able to find a list of matches like this.
- Click on the match for which you want the scores. Eg., here we click on 'IND vs WI - Live'.
- After this, we get a page something like this.
- The URL of this page is our required input.
- Paste this URL in line 14 of 'Howzat.py'.
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.
After getting the URL, we need to enter the following inputs :
-
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'.
-
show_match_status : Match status is whatever appears in red on the scores page.
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.
-
show_fours : Whether you want the notifications after a four is hit.
-
show_sixes : Whether you want the notifications after a six is hit.
-
show_wickets : Whether you want the notifications after the fall of a wicket.
-
show_EndOfOver : Whether you want the notifications after the end of an over.
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'.
That's it. You can cheer for your favourite team now!! :)