Skip to content

Instantly share code, notes, and snippets.

@zokis
Forked from fmasanori/jogos.py
Last active August 29, 2015 14:02
Show Gist options
  • Save zokis/48b3818a0747f5212651 to your computer and use it in GitHub Desktop.
Save zokis/48b3818a0747f5212651 to your computer and use it in GitHub Desktop.
# python 2.7
import urllib
import json
resp = urllib.urlopen('http://worldcup.sfg.io/matches').read()
for jogo in json.loads(resp.decode('utf-8')):
if jogo['status'] == 'completed':
print "%s %i x %s %i" % (jogo['home_team']['country'], jogo['home_team']['goals'], jogo['away_team']['country'], jogo['away_team']['goals'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment