izuemon commited on
Commit
2f1b119
·
verified ·
1 Parent(s): cf31c64

Update jihou.py

Browse files
Files changed (1) hide show
  1. jihou.py +4 -2
jihou.py CHANGED
@@ -117,14 +117,16 @@ def create_weather_body():
117
 
118
  lines.append(f"\n<b>{pref['name']}:</b>")
119
 
 
 
120
  for i, t in enumerate(times):
121
  t_jst = (
122
  datetime.fromisoformat(t)
123
  .replace(tzinfo=ZoneInfo("UTC"))
124
  .astimezone(JST)
125
  )
126
-
127
- if t_jst < today_7am:
128
  continue
129
 
130
  wc = hourly["weather_code"][i]
 
117
 
118
  lines.append(f"\n<b>{pref['name']}:</b>")
119
 
120
+ TARGET_HOURS = {7, 10, 13, 16, 21}
121
+
122
  for i, t in enumerate(times):
123
  t_jst = (
124
  datetime.fromisoformat(t)
125
  .replace(tzinfo=ZoneInfo("UTC"))
126
  .astimezone(JST)
127
  )
128
+
129
+ if t_jst.hour not in TARGET_HOURS:
130
  continue
131
 
132
  wc = hourly["weather_code"][i]