Skip to content

Instantly share code, notes, and snippets.

@milan1267
Created June 15, 2013 15:48
Show Gist options
  • Save milan1267/5788530 to your computer and use it in GitHub Desktop.
Save milan1267/5788530 to your computer and use it in GitHub Desktop.
APPKEY = "er38w9t3fqv4z56dch97d4un"
CITY = "New Delhi"
FORMAT = "json"
BASE_URL = "http://api.worldweatheronline.com/free/v1/weather.ashx"
REQUEST_URL = BASE_URL+"?q=%s&format=%s&key=%s" %(CITY,FORMAT,APPKEY)
import requests
import datetime
json_data=requests.get(REQUEST_URL).json()
data = json_data['data']['current_condition']
#temperature = data[1]['temp_C']
print data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment