Created
June 25, 2014 16:26
-
-
Save MichaelAquilina/745c6df61e4714d446b4 to your computer and use it in GitHub Desktop.
View scores of current games in the Worldcup
This file contains hidden or 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
#! /usr/bin/python | |
# View the scores of matches currently in progress | |
import requests | |
req = requests.get('http://worldcup.sfg.io/matches') | |
for match in [m for m in req.json() if m['status'] == 'in progress']: | |
print match['home_team']['country'], match['home_team']['goals'], 'v', match['away_team']['country'], match['away_team']['goals'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment