Cricket used to be awesome ! So did Maggie and Television Sitcoms (particularly Indian ones these days). But there is something with cricket that makes us nostalgic and still we watch it no matter how much time it kills. But what about Office (Sadly enough)? All the cricket sites that stream are blocked. Even the live updates page end up with the same old WebSense Blocked page. People resort to apps that make use of the feeble internet connectivity in the area and after almost five minutes elapsed after the brain triggered a craving for the latest score it gets satisfied but sad. We were three down in a important match. This adds to the interest and a chain reaction starts. We all have went through this multiple times.
Being an amateurishly equipped designer(Thanks to many MOOCs for this feeling) i thought would’nt it be great if we get the score all time in the most minimalistic yet effective way without tapping of our phones and going through all those ads to get to the SCORE. Where ever there is a problem, there is a way ! Pi Way or rather Pi-Py Way .
I did a little observational analysis to figure out how people want the score by listening to score queries that were hurled to the guy four cubicles away where the cell reception was better and he had the score always during the World Cup. Doing so i could tabulate the primary , secondary and tertiary parts of that instantaneous moment in wicket-cricket-time continuum.
Most people wanted just the score as expected.Then it was Overs> RR > 4s/6s >Who is batting team/players> Who won/What’s Up? (mostly after meetings) > Who the hell is playing ?
Also the frequency was not that constant. There were mostly 10-20 requests an hour in the beginning of the match and very few in the middle and again more at the end. So it was sort of an inverse bell curve.
The first thing required was a data source like a website/API that has all the data we need to display. We will anyway display it at 1 refresh per minute so rocket-science precision is not required. I stumbled upon this which unfortunately was not free and beyond my budget.
I thought best way is to make an API myself when there is none that suits me.
I’ll scrape !
So, i wrote a python script to scrape a popular and reliable website and display the score on the terminal. After a few days of part time labour i was able to extract the gold stuff i always wanted and then designed a logic to figure out who was playing and winning and what was the current state of the match. Then ran it on my Pi to make sure there were no dependencies were left out.
I used the adorable beautifulsoup
for scraping !
Next based on the observations, I sat down and made an interface for the info gathered be displayed.I choose my old and trusted Nokia 5510 Graphic Display.
Many thanks to Adafruit for their amazing Python Library for the LCD already available that made things easy.
Here is the first visual of a World Cup match on my project :
This too.
</a>
As you can see we have the following parts of score displayed:
Here is the picture of the setup:
A Laser cut case and we could go wall mount.
I then made the script executable and queued it as a cron-job
to be run every minute. BLISS
Now I could watch(over) cricket matches in a non-intrusive and minimalistic way .
If you too are interested you can grab the code here to check out on the process.
Here is how i kept a track of IPL :
NOTE : The project was not performed/made at the workplace. Only the use case was inspired from there.
Cheers,
Rohit