about summary refs log tree commit diff
diff options
context:
space:
mode:
authorStarfall <us@starfall.systems>2022-12-01 14:24:26 -0600
committerStarfall <us@starfall.systems>2022-12-01 14:24:26 -0600
commita0ccca8329d1e9b91e06ef1b7f58fdb09c6f6564 (patch)
tree28baf1ce3ad1d13e4b47d95c344202be87839bdb
parent1416ec325ac9a35aaa50cd1e7a77cd6112a8e5e0 (diff)
bump version to 0.2, include city and state in forecast header
-rwxr-xr-xmeteor.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/meteor.py b/meteor.py
index fb3179c..0188f06 100755
--- a/meteor.py
+++ b/meteor.py
@@ -8,7 +8,7 @@ import fscache as fs
 
 base_url = 'https://api.weather.gov'
 headers = {
-    'user-agent': 'meteor.py/0.1 (us@starfall.systems)',
+    'user-agent': 'meteor.py/0.2 (us@starfall.systems)',
     'accept': 'application/ld+json'
 }
 
@@ -72,12 +72,8 @@ def print_forecast(point):
         # probabilityOfPrecipitation is the neatest one that's not in .../forecast or .../forecast/hourly
         # but there's also relativeHumidity, apparentTemperature (and, separately, windChill), skyCover, windGust
         # downside, it appears to always convert the F/mph measurements into C/kph for no reason. e.g. all temps are measured in 9ths of C
-    
-        # TODO pick out location name from somewhere.
-        # city and state hide in point.relativeLocation.properties.city (and state)
-        # getting the county or zone's `name (id) state` is good too
 
-        buffer = f'{term.BOLD}forecast'
+        buffer = f'{term.BOLD}forecast for {point.get("relativeLocation").get("city")}, {point.get("relativeLocation").get("state")}'
         buffer += '\n' + f'===================={term.RESET}'
         periods = forecast.get('periods')
         # print today and tonight in long format