Created
June 15, 2013 15:48
-
-
Save milan1267/5788530 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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