Beispiel #1
0
def weathersvc(stationid, key):
    # Get Weather Current
    # Call API
    response = weather.get_weather_current(stationid, key)
    # parse JSON response
    weather_current = json.loads(response)

    # Get Weather Forecast
    # Call API
    response = weather.get_weather_forecast(stationid, key)
    # parse JSON response
    weather_forecast = json.loads(response)

    return weather_current, weather_forecast
Beispiel #2
0
__author__ = 'kenhopwood'

import json

from weather import weather

if __name__=='__main__':

    response = weather.get_weather_current('5325738', 'key')
    print response
    weather_current = json.loads(response)
    print(json.dumps(weather_current))

    response = weather.get_weather_forecast('5325738', 'key')
    print response
    weather_forecast = json.loads(response)
    print(json.dumps(weather_forecast))