Skip to content

Instantly share code, notes, and snippets.

@pvleite
pvleite / jogos.php
Last active August 29, 2015 14:02 — forked from AlexSJ/jogos.php
<?php
foreach(json_decode(file_get_contents("http://worldcup.sfg.io/matches")) as $jogo) {
echo $jogo->status == 'completed' ? $jogo->home_team->country . '(' . $jogo->home_team->goals . ') x (' . $jogo->away_team->goals . ')' . $jogo->away_team->country . '<br>' : '';
}
@pvleite
pvleite / ChuckJokesPython3.py
Last active August 29, 2015 13:55 — forked from fmasanori/ChuckJokesPython3.py
Mostra um fact do Chuck Norris a cada 5 segundos
import urllib.request
import json
import time
url = 'http://api.icndb.com/jokes?limitTo=[nerdy]'
resp = urllib.request.urlopen(url).read()
data = json.loads(resp.decode('utf-8'))
for d in data['value']:
print (d['joke'])