forked from semk/cricinfo
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
ESPNcricinfo is the largest[citation needed] cricket-related website. It includes news and articles, live scorecards, and a comprehensive and queriable database of historical matches and players from the 18th century to the present. | ||
|
||
This Python libary provides an api for accessing information from CricInfo like live scores, news updates and player profiles. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#! /usr/bin/env python | ||
# | ||
# Python library for accessing information from http://cricinfo.com | ||
# (Live scores and updates) | ||
# | ||
# @author: Sreejith K | ||
# Created On: 24 Nov 2010 | ||
|
||
import urllib | ||
|
||
live_scores_xml = 'http://espncricinfo.com/rss/livescores.xml' | ||
|
||
class CricInfo: | ||
|
||
def __init__(self, live_scores_xml = live_scores_xml): | ||
self.live_scores_xml = live_scores_xml | ||
self.xml_data = None | ||
self.live_scores = {} | ||
|
||
def get_xml_data(self): | ||
self.xml_data = urllib.urlopen(self.live_scores_xml) | ||
|
||
def update_live_scores(self): | ||
self.get_xml_data() | ||
self.live_scores = self.parse_xml() | ||
|
||
def parse_xml(self): | ||
# parse the xml and populate the dictionary with needed information. | ||
pass | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<rss version="2.0"> | ||
<channel> | ||
<title>Cricinfo Live Scores</title> | ||
<ttl>2</ttl> | ||
<link>http://www.cricinfo.com</link> | ||
<description>Latest scores from Cricinfo</description> | ||
<copyright>(c)Cricinfo</copyright> | ||
<language>en-gb</language> | ||
<pubDate>Tue, 23 Nov 2010 18:58:03 +0000</pubDate> | ||
|
||
<item> | ||
<title>Pakistan 434/10 v South Africa 584/9 & 173/4 *</title> | ||
<link>http://www.cricinfo.com/ci/engine/match/461572.html?CMP=OTC-RSS</link> | ||
<description>Pakistan 434/10 v South Africa 584/9 & 173/4 *</description> | ||
<guid>http://www.cricinfo.com/ci/engine/match/461572.html</guid> </item> | ||
<item> | ||
<title>Sri Lanka 84/3 * v West Indies</title> | ||
|
||
<link>http://www.cricinfo.com/ci/engine/match/464988.html?CMP=OTC-RSS</link> | ||
<description>Sri Lanka 84/3 * v West Indies</description> | ||
<guid>http://www.cricinfo.com/ci/engine/match/464988.html</guid> </item> | ||
<item> | ||
<title>Victoria v Queensland</title> | ||
<link>http://www.cricinfo.com/ci/engine/match/474064.html?CMP=OTC-RSS</link> | ||
<description>Victoria v Queensland</description> | ||
<guid>http://www.cricinfo.com/ci/engine/match/474064.html</guid> </item> | ||
|
||
</channel> | ||
</rss> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#! /usr/bin/env python | ||
# | ||
# Python library for accessing information from http://cricinfo.com | ||
# (Live scores and updates) | ||
# | ||
# @author: Sreejith K | ||
# Created On: 24 Nov 2010 | ||
|
||
|