Skip to content

Instantly share code, notes, and snippets.

@Santiago-j-s
Last active June 15, 2018 18:29
Show Gist options
  • Save Santiago-j-s/933ef1c764a9b0c5212f58385ca4474a to your computer and use it in GitHub Desktop.
Save Santiago-j-s/933ef1c764a9b0c5212f58385ca4474a to your computer and use it in GitHub Desktop.
resultados.py
#!/usr/bin/env python3
import requests
partidos = requests.get('http://worldcup.sfg.io/matches').json()
[
print(
p['home_team']['country'], p['home_team']['goals'],
'x',
p['away_team']['country'], p['away_team']['goals'],
'# finalizado' if p['status'] == 'completed' else ''
) for p in partidos if p['status'] in ('completed', 'in progress')
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment