Created
October 24, 2019 10:56
-
-
Save Allwin12/b9be5dedece8c134d66ad6dc94b44440 to your computer and use it in GitHub Desktop.
Get live cricket score every 60 seconds using python - Linux only
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
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