Introduction :
We know that it is very hard to create a live cricket score website , Because it consist live update . Updating our website as per the score which show in Television was very hard . So it is better to find an another outsource to get the live updates to our website . Most of the webmasters where using Widgets for show live-cricket score on their website . But the problem with Widgets was , They show the owner website address below the Widget . This will cause the website which show live cricket score widget user website . Through this article you are going to learn about fetching live cricket score from cricinfo using their Xml data with the help of Php .
What is Cricinfo :
Cricinfo is a famous cricket news website , People visiting the site for getting new and information related to the cricket . Actually Cricinfo not providing any API for showing the Live Cricket Score , But they proving live Xml data .
Demo : Click for Demo
Demo : Click for Demo
How to Create Live Score Website Using Cricinfo XML File :
It is very easy to create Live Cricket Score website using Cricinfo XML File , Just follow the below steps to finish the process .
- First of all you need to create a page to show the Live Cricket Score Updates .
- Copy/Paste the following Php code to the page which you created .
<html> <head> <title>Cricinfo - Live Cricket Score Update</title> <link rel="stylesheet" href="http://shine4mobile.hexat.com/creator_template.css" type="text/css" /> </head> <body> <h1>Live Cricket Score Feed</h1> <?php $rss = simplexml_load_file('http://static.cricinfo.com/rss/livescores.xml'); foreach ($rss->channel->item as $item) { echo '<div class="line">'; echo "<p>" . $item->description . "</p>"; echo '</div>'; } ?> </body> </html>
- Save the page you create for showing live cricket score , After pasting the above Php code .
- Open the page you create "http://yoursite.com/cric.php" .
- You are done .
By creating a live cricket score website , You can increase your website visitors and earn more impression and money . It is a simple script that i made . If you want to add more additional feature just ask me using the comment box .
No comments:
Post a Comment