在 Manus 中运行任何 Skill
一键导入
一键导入
一键在 Manus 中运行任何 Skill
开始使用get-weather
星标3
分支0
更新时间2026年3月2日 03:39
获取指定城市的实时天气信息
安装
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
SKILL.md
readonly菜单
获取指定城市的实时天气信息
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
| name | get_weather |
| description | 获取指定城市的实时天气信息 |
此技能用于获取指定城市的实时天气信息。
fetch_url 工具访问天气APIimport json
# 使用fetch_url获取天气数据
url = f"https://api.openweathermap.org/data/2.5/weather?q={city}&appid=YOUR_API_KEY&units=metric&lang=zh_cn"
data = fetch_url(url)
# 解析JSON数据
weather_data = json.loads(data)
# 提取天气信息
city_name = weather_data.get("name")
temperature = weather_data.get("main", {}).get("temp")
humidity = weather_data.get("main", {}).get("humidity")
weather_description = weather_data.get("weather", [{}])[0].get("description")
# 格式化返回
result = f"{city_name}的当前天气:{weather_description},温度:{temperature}°C,湿度:{humidity}%"