Skip to content

Instantly share code, notes, and snippets.

@Allwin12
Created October 24, 2019 10:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Allwin12/b9be5dedece8c134d66ad6dc94b44440 to your computer and use it in GitHub Desktop.
Save Allwin12/b9be5dedece8c134d66ad6dc94b44440 to your computer and use it in GitHub Desktop.
Get live cricket score every 60 seconds using python - Linux only
import subprocess
from bs4 import BeautifulSoup
import requests
import time
while True:
url = "http://static.cricinfo.com/rss/livescores.xml"
r = requests.get(url)
soup = BeautifulSoup(r.text, "html.parser")
data = soup.find_all("description")
score = data[1].text
subprocess.Popen(['notify-send', score])
time.sleep(60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment