返回顶部
q

qweather-city-weatherQWeather城市天气

Query QWeather city codes and real-time weather with bundled executable scripts. Use when users need to resolve city names to QWeather location IDs/adcodes, fetch current weather, or run portable weather queries on machines that do not host the original app.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.1
安全检测
已通过
288
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

qweather-city-weather

qweather-city-weather

主要通过捆绑脚本使用此技能:

  • - scripts/qweather_query.py

这使得该技能可在不同机器间移植,且不依赖本地Next.js服务。

前置条件

  • - 需要Python 3.10+环境
  • 需要和风天气API密钥:
- 设置环境变量 QWEATHERAPIKEY,或 - 通过 --api-key 参数传入
  • - 需要和风天气API主机地址:
- 设置环境变量 QWEATHERAPIHOST,或 - 通过 --api-host 参数传入

默认执行流程

  1. 1. 搜索城市候选并获取地点ID:

bash
python3 scripts/qweatherquery.py search-city --query 杭州 --api-host APIHOST> --api-key API_KEY>

  1. 2. 通过 id/name/adm1/adm2 选择最佳城市。
  1. 3. 使用地点ID查询当前天气:

bash
python3 scripts/qweatherquery.py get-weather --location 101210101 --api-host APIHOST> --api-key API_KEY>

  1. 4. 或一键执行城市到天气的查询:

bash
python3 scripts/qweatherquery.py city-weather --query 杭州 --api-host APIHOST> --api-key API_KEY>

脚本命令参考

  • - search-city
- 必需参数:--query - 可选参数:--number(默认值 10)
  • - get-weather
- 必需参数:--location
  • - city-weather
- 必需参数:--query - 可选参数:--preferred-name 用于精确匹配城市名称

所有子命令的全局选项:

  • - --api-key
  • --api-host
  • --timeout(秒,默认值 5.0)

输出与错误约定

  • - 成功:返回包含 success: true 的JSON
  • 失败:返回包含 success: false + error 的JSON,进程以非零状态退出
  • 无结果时绝不猜测城市;直接返回明确的未匹配失败信息

直接API参考

有关官方和风天气API的端点和负载详情,请参阅:

  • - references/qweather-http-contract.md

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 qweather-city-weather-1776206886 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 qweather-city-weather-1776206886 技能

通过命令行安装

skillhub install qweather-city-weather-1776206886

下载

⬇ 下载 qweather-city-weather v1.0.1(免费)

文件大小: 5.26 KB | 发布时间: 2026-4-15 13:38

v1.0.1 最新 2026-4-15 13:38
Initial portable release using QWEATHER_API_HOST and QWEATHER_API_KEY only.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large