cwadayi commited on
Commit
a289bfe
·
verified ·
1 Parent(s): 55d9047

Update usgs_service.py

Browse files
Files changed (1) hide show
  1. usgs_service.py +3 -2
usgs_service.py CHANGED
@@ -33,7 +33,8 @@ def fetch_global_last24h_text(min_mag: float = 5.0, limit: int = 10) -> str:
33
  t_utc = datetime.fromtimestamp(p["time"] / 1000, tz=timezone.utc)
34
 
35
  lines.append(
36
- f"震級: {p['mag']:.1f} | 日期時間: {t_utc.strftime('%Y-%m-%d %H:%M')} (UTC)\n"
 
37
  f"地點: {p.get('place', 'N/A')}\n"
38
  f"報告連結: {p.get('url', '無')}"
39
  )
@@ -70,7 +71,7 @@ def fetch_taiwan_df_this_year(min_mag: float = 5.0) -> pd.DataFrame | str:
70
  "magnitude": p["mag"],
71
  "place": p.get("place", ""),
72
  "time_utc": datetime.fromtimestamp(p["time"]/1000, tz=timezone.utc),
73
- "url": p.get("url", "") # [新增] 將 url 欄位加入
74
  })
75
  return pd.DataFrame(rows)
76
  except Exception as e:
 
33
  t_utc = datetime.fromtimestamp(p["time"] / 1000, tz=timezone.utc)
34
 
35
  lines.append(
36
+ # [修改] "震級" 改為 "規模"
37
+ f"規模: {p['mag']:.1f} | 日期時間: {t_utc.strftime('%Y-%m-%d %H:%M')} (UTC)\n"
38
  f"地點: {p.get('place', 'N/A')}\n"
39
  f"報告連結: {p.get('url', '無')}"
40
  )
 
71
  "magnitude": p["mag"],
72
  "place": p.get("place", ""),
73
  "time_utc": datetime.fromtimestamp(p["time"]/1000, tz=timezone.utc),
74
+ "url": p.get("url", "")
75
  })
76
  return pd.DataFrame(rows)
77
  except Exception as e: