weather updates
This commit is contained in:
@@ -245,6 +245,8 @@ def updateWeather(location, api_key):
|
||||
current_weather['wind_direction'] = weather['wind']['deg']
|
||||
current_weather['visibility'] = weather['visibility']
|
||||
current_weather['uv'] = r.json()['current']['uvi']
|
||||
current_weather['rain_chance'] = r.json()['hourly'][0]['pop']
|
||||
|
||||
|
||||
json.dump( current_weather, open( "csv/current_weather.json", 'w+' ))
|
||||
|
||||
@@ -259,8 +261,7 @@ def updateWeather(location, api_key):
|
||||
dct['min_temp'] = day['temp']['min']
|
||||
dct['max_temp'] = day['temp']['max']
|
||||
daily_weather.append(dct)
|
||||
|
||||
|
||||
|
||||
json.dump( daily_weather, open( "csv/daily_weather.json", 'w+' ))
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
Reference in New Issue
Block a user