How to ? Websites and Blogs Widgets

How To Put Live Cricket Score On Your Website

Putting a LIVE cricket score on your website is now very easy. Thanks to http://www.cricbuzz.com for providing a feed for live matches. Today we will discuss a method by which you can get the LIVE cricket score with the help of Javascript and Yahoo Query Language (YQL). Not only in your website but you can also put it in your PC and can view the score instantly. This will be very useful in some places where the sports related websites are blocked.

How does it work ?

Cricbuzz provides an XML feed which shows live matches and scores. We have written a script which will fetch the XML data with the help of Yahoo Query Language (YQL) and read the data using JavaScript. Everything will happen almost instantly. It can be viewed in any browser. It will show you match details, place, current score and the status. Lets have a live demo.

How to display only a single match ?

If you look at the JavaScript code, you can find a line saying var ONLY_SHOW_MATCH_FOR = "";

You can simply change its value to filter out matches. For example, to show only the India vs Australia match, open the live demo and see the first line (AUS vs IND). Copy this line and set it there for ONLY_SHOW_MATCH_FOR. So you should change the line to var ONLY_SHOW_MATCH_FOR = "AUS vs IND";

For any help drop a comment 🙂

15 thoughts on “How To Put Live Cricket Score On Your Website”

  1. it displaying old matches..
    Today’s match is India v/s Shrilanka, but there is display nothing about this match score or anything…

      1. Thanks for the reply… I have one more query!!! I have seen that score was not live when i had implemented on my web page. It was showing 2 overs delay. Is there anything to fix it.

  2. hi
    i wanted to know if its possible to retrieve the entire scorecard, along with team details of upcoming fixtures and other data. if yes, please help me out..
    thanks and regards
    dhruv

  3. I am working on same thing, i.e. cricket live streaming. Can anyone share the script(javascript/php) they used?
    Sir, I think you missed to share your javascript code ! but have mentioned it in between please share hte code too.

Leave a Reply

Your email address will not be published. Required fields are marked *