Skip to content

Instantly share code, notes, and snippets.

View radumas's full-sized avatar

Raphael Dumas radumas

View GitHub Profile
@radumas
radumas / wunderground_current.py
Created June 18, 2016 02:51 — forked from philshem/wunderground_current.py
Wunderground API: Streamlined python 2.7 code using the requests package. Must register at http://www.wunderground.com/weather/api/ and insert your personal key.
import requests
data = requests.get('http://api.wunderground.com/api/INSERT_KEY_HERE/geolookup/conditions/q/Switzerland/Zurich.json').json()
location = data['location']['city']
temp_c = data['current_observation']['temp_c']
print "Current temperature in %s is: %s C" % (location, temp_c)