Created
April 11, 2015 02:20
-
-
Save sterfry1988/014c80f8a9629c7fada0 to your computer and use it in GitHub Desktop.
This file contains 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
import requests | |
from datetime import datetime | |
SJC_HISTORY_URL = "http://api.wunderground.com/api/api_key/history_%s/q/CA/San_Jose.json" | |
def makeRequests(): | |
today = datetime.date.today() | |
temperatures = {} | |
#Start the range at 1 and go to 8 to ensure we go back 7 days. | |
for x in range(1,8): | |
request_date = (today - datetime.timedelta(days=x)).isoformat() | |
#Do I need to do this asynchronusly or will the loop wait for the request to complete? | |
request = requests.get(SJC_HISTORY_URL % request_date) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment