← 返回
未分类 中文

Weather 2.0

Weather and forecasts (no API key). One wttr.in fetch by default; Open-Meteo if that fails. Chat-style answers — see “How to answer”.
天气预报(无需 API 密钥)。默认一次获取wttr.in;若失败则切换至 Open‑Meteo。聊天式回答——请参见‘如何回答’。
maximedogawa maximedogawa 来源
未分类 clawhub v1.0.1 1 版本 100000 Key: 无需
★ 0
Stars
📥 393
下载
💾 0
安装
1
版本
#latest

概述

Weather

Free: wttr.in (text) and Open-Meteo (JSON). No keys.

Default: one small request

Prefer a short forecast to save tokens and latency:

  • 1–2 days (typical “today / tomorrow / morgen”): https://wttr.in/PLACE?2&m — spaces → +. 2 = two-day forecast, m = metric.
  • Full multi-day table only if the user asks for the week, several days, or ?2 is not enough: https://wttr.in/PLACE?T&m (T = full terminal layout).

If the body looks like a real forecast → summarize and stop. No Open-Meteo unless wttr failed, error page, or you need JSON.

How to answer

Chat, not a datasheet: short intro on how it _feels_, then compact day lines (date, °C, rain when it matters). No lat/long, WMO codes, or bold datasheet headings unless the user asked for technical detail.

wttr.in (curl / fetch)

GoalExample
--------------------------------------------------------------------------
Short (default), 1–2 dayscurl -s "wttr.in/London?2&m"
Full week-style tablecurl -s "wttr.in/London?T&m"
One line nowcurl -s "wttr.in/London?format=3"
Custom one-linercurl -s "wttr.in/London?format=%l:+%c+%t+%h+%w"

Tips: + for spaces; ?m / ?u units; ?1 today only; ?0 now only; airports wttr.in/JFK; PNG wttr.in/Berlin.png.

Open-Meteo (fallback)

Hosts: geocoding-api.open-meteo.com, api.open-meteo.com only — not open-meteo.com HTML.

Flow (max 2 geocode + 1 forecast):

  1. https://geocoding-api.open-meteo.com/v1/search?name=PLACE&count=10 (spaces as +)
  2. If results missing/empty: one retry — shorter name + countryCode Pick the row whose admin3/admin2/admin1 matches the user phrase.
  3. https://api.open-meteo.com/v1/forecast?latitude=LAT&longitude=LON&daily=temperature_2m_max,temperature_2m_min,precipitation_probability_max,weathercode&forecast_days=7&timezone=auto — extend forecast_days to 7–16 if they asked for more days.

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

JSON: daily.time, temperature_2m_max / _min, precipitation_probability_max, weathercode — translate codes to plain words (see weather codes); never paste codes to the user unless asked.

When to use

Named place — current weather or forecast.

版本历史

共 1 个版本

  • v1.0.1 当前
    2026-05-07 07:47 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

data-analysis

News Corbett Report

maximedogawa
Corbett 报道 — 官方 WordPress RSS,网址 corbettreport.com/feed/。仅抓取;用英文回答;严格从 XML 中提取条目;日期标题,编号列表,...
★ 0 📥 505
life-service

Caldav Calendar

asleep123
使用 vdirsyncer + khal 同步并查询 CalDAV 日历(iCloud、Google、Fastmail、Nextcloud 等)。适用于 Linux。
★ 244 📥 30,675
life-service

Sonoscli

steipete
控制Sonos音箱(发现/状态/播放/音量/分组)
★ 56 📥 85,221