Weather技能使用说明

subsun 1个月前 (03-23) openclaw小龙虾 134 0

天气

两项免费服务,无需API密钥。

wttr.in(主要服务)

快速单行命令:

curl -s "wttr.in/London?format=3"
# 输出:London: ⛅️ +8°C

紧凑格式:

curl -s "wttr.in/London?format=%l:+%c+%t+%h+%w"
# 输出:London: ⛅️ +8°C 71% ↙5km/h

完整预报:

curl -s "wttr.in/London?T"

格式代码:%c天气状况 ·%t温度 ·%h湿度 ·%w风速 ·%l地点 ·%m月相

提示:

  • URL编码空格:wttr.in/New+York
  • 机场代码:wttr.in/JFK
  • 单位:?m(公制)?u(美国惯用单位)
  • 仅显示今天:?1· 仅显示当前天气:?0
  • PNG格式:curl -s "wttr.in/Berlin.png" -o /tmp/weather.png

Open-Meteo(备用方案,JSON格式)

免费,无需密钥,适合编程使用:

curl -s "https://api.open-meteo.com/v1/forecast?latitude=51.5&longitude=-0.12&current_weather=true"

查找城市的坐标,然后进行查询。返回包含温度、风速、天气代码的JSON数据。

文档:https://open-meteo.com/en/docs

天猫隐藏优惠券

网淘吧

免责申明
部分文章来自各大搜索引擎,如有侵权,请与我联系删除。
打赏

相关推荐

网友评论

  • (*)

最新评论

用户管理

您好,欢迎到访网站!
    用户注册

上网淘巴领天猫淘宝优惠券,一年省好几千。

广告  ×

您是本站第817897名访客 今日有0篇新文章/评论