Project Introduction

Objective

You will implement the functionality which features regular updates of a cricket match on a Telegram group.


Project Context

Cricket fans, raise your foam fingers if you have been looking for a quicker way to share scores and updates with your friends. Even if you aren’t a sports enthusiast, think about the number of fans who are out there looking for an option like this on their phones. Sports websites do offer live scores on their page which is what the majority of the people follow to stay updated on live updates if they are not watching a match.


But the thing with these websites is that you have to keep staring at the page or refreshing it to get the latest score which can be quite unproductive if you are in the middle of important work. Moreover, every time you want to share the joy of a SIX or a wicket with your friend, you have to manually share it via a messaging app.


But now, you can build a better solution for the millions of sports fans (including yourself if you raised your foam finger) and even learn important concepts in that process.


Product Architecture

This Product Architecture consists of 4 stages as follows:

image alt text

High-Level Approach & Flows

  • Get the live score

image alt text

  • Extract critical events

image alt text

  • Notification to Telegram - This is the output which is the result of this project.

image alt text

Primary goals

  • Build the Score Alerts functionality from scratch using python

  • Compile, test the functionality and publish

Pre-requisite skills

  • Python

Post Project Skills

  • REST

  • HTTP

  • Jackson

Objective

You will implement the functionality which features regular updates of a cricket match on a Telegram group.


Project Context

Cricket fans, raise your foam fingers if you have been looking for a quicker way to share scores and updates with your friends. Even if you aren’t a sports enthusiast, think about the number of fans who are out there looking for an option like this on their phones. Sports websites do offer live scores on their page which is what the majority of the people follow to stay updated on live updates if they are not watching a match.


But the thing with these websites is that you have to keep staring at the page or refreshing it to get the latest score which can be quite unproductive if you are in the middle of important work. Moreover, every time you want to share the joy of a SIX or a wicket with your friend, you have to manually share it via a messaging app.


But now, you can build a better solution for the millions of sports fans (including yourself if you raised your foam finger) and even learn important concepts in that process.


Product Architecture

This Product Architecture consists of 4 stages as follows:

image alt text

High-Level Approach & Flows

  • Get the live score

image alt text

  • Extract critical events

image alt text

  • Notification to Telegram - This is the output which is the result of this project.

image alt text

Primary goals

  • Build the Score Alerts functionality from scratch using python

  • Compile, test the functionality and publish

Pre-requisite skills

  • Python

Post Project Skills

  • REST

  • HTTP

  • Jackson

Proof of Concept

First validate the idea by doing a low level implementation (Proof of Concept) of the components involved in the project.


This helps you to:

  1. Get more clarity around the unknowns.

  2. Get a better understanding of the stages involved in the project.


Requirements

  • Explore "https://www.espncricinfo.com/".

  • Select a scoreboard of a match and inspect elements to figure out the api which is responsible for the showcase of scores.

  • Checkout the response of the API.

  • Understand about the telegram bot and the APIs used for sending messages and receiving updates.


Expected Outcome

The idea of this Milestone is that you should explore all the components which are to be stitched together in the upcoming modules.


Fetching the live scores and Parsing Data

Now that we are done with the POC, we can implement the various components of our project.


In this milestone, you need to implement the functionality that will enable users to fetch the live scores of the match from the website and extract the information needed.


Requirements

  • Use the API from "cricinfo" website and fetch the live scores of a match.

  • To understand more about the API, complete the Hyperlink and REST bytes from the Crio Bytes Section.

  • Parse the data to extract the meaningful data such as balls, wickets, Target score etc.


Expected Outcome

You should be able to execute the API from the "cricinfo" website and verify whether the necessary values required for the live scores are obtained.


Notifying the users

Once the required information is acquired, next we need to implement the functionality that will notify the users by sending the live scores to the Telegram group.


Requirements

  • Use the Hyperlink API to send a notification in a group or to an individual on Telegram.

  • The Notification should consist of all the necessary information parsed from the data obtained from the live scores website.

Expected Outcome

You should be able to verify whether the test notification is received on Telegram.


Recurring Notifications

Come up with a script such that the user is notified about the live scores periodically.


Requirements

  • Use Either python or shell script to make sure that the notifications are sent at regular intervals without manual interventions.

  • Make sure that the same events are not repeatedly sent as notifications to the user to prevent duplicate notification scenarios.

  • Run the script and monitor the notifications on Telegram for an interval.


Expected Outcome

By the end of this milestone, the core implementation of your application should be complete. Your application should be able to call the API, fetch and parse the required information, and should be able to send recurring updates on Telegram.


Spice it up!

As the basic implementation is all done, for all the curious cats out there, these are some of the line items which can be implemented to spice up the existing functionality.

[Note: This is not a mandatory milestone]


Requirements

  • Try to do the following:

    • Can you run the python script as a lambda function?

    • Can you make a Chrome plugin out of this functionality?

    • Can you send SMS/Email notifications instead of Telegram?

    • Can you add the feature to your application such that it can auto select a live match and provide its regular updates?


Expected Outcome

You should be able to add more features to your application, without breaking any pre-existing code.


Publish to GitHub

Hurrah!


Congratulations on completing the project successfully. Publish to your Git Repository and Showoff to your friends!


[Note: Kindly go through this Byte if you’re unfamiliar with Git.]