actually use an f-string when querying wttr.in

This commit is contained in:
Brian S. Stephan 2019-10-06 10:44:21 -05:00
parent 5f6e255ded
commit d5e1a2ed45
1 changed files with 3 additions and 3 deletions

View File

@ -8,8 +8,8 @@ logger = logging.getLogger(__name__)
def query_wttr_in(query):
"""Hit the wttr.in JSON API with the provided query."""
logger.info(f"about to query wttr.in with '{query}")
response = requests.get('http://wttr.in/{query}?format=j1')
logger.info(f"about to query wttr.in with '{query}'")
response = requests.get(f'http://wttr.in/{query}?format=j1')
response.raise_for_status()
weather_info = response.json()
@ -19,7 +19,7 @@ def query_wttr_in(query):
def weather_summary(query):
"""Create a more consumable version of the weather report."""
logger.info(f"assembling weather summary for '{query}")
logger.info(f"assembling weather summary for '{query}'")
weather_info = query_wttr_in(query)
# get some common/nested stuff once now