Skip to content

Commit

Permalink
Initial Commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Anubhav committed Mar 24, 2015
0 parents commit bc1b7a6
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions scorer.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python2
import requests
from bs4 import BeautifulSoup
import pynotify
from time import sleep
def sendmessage(title, message):
pynotify.init("Test")
notice = pynotify.Notification(title, message)
notice.show()
return
url = "http://static.cricinfo.com/rss/livescores.xml"
while True:
r = requests.get(url)
while r.status_code is not 200:
r = requests.get(url)
soup = BeautifulSoup(r.text)
data = soup.find_all("description")
score = data[2].text
sendmessage("Score", score)
sleep(60)

0 comments on commit bc1b7a6

Please sign in to comment.