weather-query by vikiboss/60s-skills
npx skills add https://github.com/vikiboss/60s-skills --skill weather-query此技能使 AI 代理能够使用 60s API 获取中国地区的实时天气信息和天气预报。
当用户出现以下情况时使用此技能:
URL: https://60s.viki.moe/v2/weather/realtime
方法: GET
URL: https://60s.viki.moe/v2/weather/forecast
方法: GET
query (必需): 中文地点名称
import requests
def get_realtime_weather(query):
url = 'https://60s.viki.moe/v2/weather/realtime'
response = requests.get(url, params={'query': query})
return response.json()
# 示例
weather = get_realtime_weather('北京')
print(f"☁️ {weather['location']}天气")
print(f"🌡️ 温度:{weather['temperature']}°C")
print(f"💨 风速:{weather['wind']}")
print(f"💧 湿度:{weather['humidity']}")
广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
def get_weather_forecast(query):
url = 'https://60s.viki.moe/v2/weather/forecast'
response = requests.get(url, params={'query': query})
return response.json()
# 示例
forecast = get_weather_forecast('上海')
for day in forecast['forecast']:
print(f"{day['date']}: {day['weather']} {day['temp_low']}°C ~ {day['temp_high']}°C")
# 实时天气
curl "https://60s.viki.moe/v2/weather/realtime?query=北京"
# 天气预报
curl "https://60s.viki.moe/v2/weather/forecast?query=上海"
{
"location": "北京",
"weather": "晴",
"temperature": "15",
"humidity": "45%",
"wind": "东北风3级",
"air_quality": "良",
"updated": "2024-01-15 14:00:00"
}
{
"location": "上海",
"forecast": [
{
"date": "2024-01-15",
"day_of_week": "星期一",
"weather": "多云",
"temp_low": "10",
"temp_high": "18",
"wind": "东风3-4级"
},
...
]
}
代理响应:
weather = get_realtime_weather('北京')
response = f"""
☁️ 北京今日天气
天气状况:{weather['weather']}
🌡️ 温度:{weather['temperature']}°C
💧 湿度:{weather['humidity']}
💨 风力:{weather['wind']}
🌫️ 空气质量:{weather['air_quality']}
"""
forecast = get_weather_forecast('上海')
response = "📅 上海未来天气预报\n\n"
for day in forecast['forecast'][:3]:
response += f"{day['date']} {day['day_of_week']}\n"
response += f" {day['weather']} {day['temp_low']}°C ~ {day['temp_high']}°C\n"
response += f" {day['wind']}\n\n"
weather = get_realtime_weather('深圳')
if '雨' in weather['weather']:
print("☔ 是的,深圳现在正在下雨")
print("建议带伞出门!")
else:
forecast = get_weather_forecast('深圳')
rain_days = [d for d in forecast['forecast'] if '雨' in d['weather']]
if rain_days:
print(f"未来{rain_days[0]['date']}可能会下雨")
else:
print("近期没有降雨预报")
地点名称 : 始终使用中文汉字表示地点名称
错误处理 : 在显示结果前检查地点是否有效
上下文建议 : 根据天气状况提供相关建议
缓存 : 天气数据会定期更新,但可以短期缓存
备用方案 : 如果特定区县无效,尝试使用城市名称
def give_weather_advice(location):
weather = get_realtime_weather(location)
advice = []
temp = int(weather['temperature'])
if temp > 30:
advice.append("🔥 天气炎热,注意防暑降温,多喝水")
elif temp < 5:
advice.append("🥶 天气寒冷,注意保暖")
if '雨' in weather['weather']:
advice.append("☔ 记得带伞")
if weather['air_quality'] in ['差', '重度污染']:
advice.append("😷 空气质量不佳,建议戴口罩")
return '\n'.join(advice)
def compare_weather(cities):
results = []
for city in cities:
weather = get_realtime_weather(city)
results.append({
'city': city,
'temperature': int(weather['temperature']),
'weather': weather['weather']
})
# 找出最热和最冷
hottest = max(results, key=lambda x: x['temperature'])
coldest = min(results, key=lambda x: x['temperature'])
return f"🌡️ 最热: {hottest['city']} {hottest['temperature']}°C\n" \
f"❄️ 最冷: {coldest['city']} {coldest['temperature']}°C"
def check_travel_weather(destination, days=3):
forecast = get_weather_forecast(destination)
suitable_days = []
for day in forecast['forecast'][:days]:
if '雨' not in day['weather'] and '雪' not in day['weather']:
suitable_days.append(day['date'])
if suitable_days:
return f"✅ {destination}适合出行的日期:{', '.join(suitable_days)}"
else:
return f"⚠️ 未来{days}天{destination}天气不太适合出行"
updated 时间戳天气 API 支持中国大部分城市和区县,包括:
每周安装次数
402
仓库
GitHub 星标数
21
首次出现
Feb 9, 2026
安全审计
安装于
opencode368
github-copilot367
codex363
gemini-cli362
cursor361
kimi-cli356
This skill enables AI agents to fetch real-time weather information and forecasts for locations in China using the 60s API.
Use this skill when users:
URL: https://60s.viki.moe/v2/weather/realtime
Method: GET
URL: https://60s.viki.moe/v2/weather/forecast
Method: GET
query (required): Location name in Chinese
import requests
def get_realtime_weather(query):
url = 'https://60s.viki.moe/v2/weather/realtime'
response = requests.get(url, params={'query': query})
return response.json()
# Example
weather = get_realtime_weather('北京')
print(f"☁️ {weather['location']}天气")
print(f"🌡️ 温度:{weather['temperature']}°C")
print(f"💨 风速:{weather['wind']}")
print(f"💧 湿度:{weather['humidity']}")
def get_weather_forecast(query):
url = 'https://60s.viki.moe/v2/weather/forecast'
response = requests.get(url, params={'query': query})
return response.json()
# Example
forecast = get_weather_forecast('上海')
for day in forecast['forecast']:
print(f"{day['date']}: {day['weather']} {day['temp_low']}°C ~ {day['temp_high']}°C")
# Real-time weather
curl "https://60s.viki.moe/v2/weather/realtime?query=北京"
# Weather forecast
curl "https://60s.viki.moe/v2/weather/forecast?query=上海"
{
"location": "北京",
"weather": "晴",
"temperature": "15",
"humidity": "45%",
"wind": "东北风3级",
"air_quality": "良",
"updated": "2024-01-15 14:00:00"
}
{
"location": "上海",
"forecast": [
{
"date": "2024-01-15",
"day_of_week": "星期一",
"weather": "多云",
"temp_low": "10",
"temp_high": "18",
"wind": "东风3-4级"
},
...
]
}
Agent Response:
weather = get_realtime_weather('北京')
response = f"""
☁️ 北京今日天气
天气状况:{weather['weather']}
🌡️ 温度:{weather['temperature']}°C
💧 湿度:{weather['humidity']}
💨 风力:{weather['wind']}
🌫️ 空气质量:{weather['air_quality']}
"""
forecast = get_weather_forecast('上海')
response = "📅 上海未来天气预报\n\n"
for day in forecast['forecast'][:3]:
response += f"{day['date']} {day['day_of_week']}\n"
response += f" {day['weather']} {day['temp_low']}°C ~ {day['temp_high']}°C\n"
response += f" {day['wind']}\n\n"
weather = get_realtime_weather('深圳')
if '雨' in weather['weather']:
print("☔ 是的,深圳现在正在下雨")
print("建议带伞出门!")
else:
forecast = get_weather_forecast('深圳')
rain_days = [d for d in forecast['forecast'] if '雨' in d['weather']]
if rain_days:
print(f"未来{rain_days[0]['date']}可能会下雨")
else:
print("近期没有降雨预报")
Location Names : Always use Chinese characters for location names
Error Handling : Check if the location is valid before displaying results
Context : Provide relevant context based on weather conditions
Caching : Weather data is updated regularly but can be cached for short periods
Fallbacks : If a specific district doesn't work, try the city name
def give_weather_advice(location):
weather = get_realtime_weather(location)
advice = []
temp = int(weather['temperature'])
if temp > 30:
advice.append("🔥 天气炎热,注意防暑降温,多喝水")
elif temp < 5:
advice.append("🥶 天气寒冷,注意保暖")
if '雨' in weather['weather']:
advice.append("☔ 记得带伞")
if weather['air_quality'] in ['差', '重度污染']:
advice.append("😷 空气质量不佳,建议戴口罩")
return '\n'.join(advice)
def compare_weather(cities):
results = []
for city in cities:
weather = get_realtime_weather(city)
results.append({
'city': city,
'temperature': int(weather['temperature']),
'weather': weather['weather']
})
# Find hottest and coldest
hottest = max(results, key=lambda x: x['temperature'])
coldest = min(results, key=lambda x: x['temperature'])
return f"🌡️ 最热: {hottest['city']} {hottest['temperature']}°C\n" \
f"❄️ 最冷: {coldest['city']} {coldest['temperature']}°C"
def check_travel_weather(destination, days=3):
forecast = get_weather_forecast(destination)
suitable_days = []
for day in forecast['forecast'][:days]:
if '雨' not in day['weather'] and '雪' not in day['weather']:
suitable_days.append(day['date'])
if suitable_days:
return f"✅ {destination}适合出行的日期:{', '.join(suitable_days)}"
else:
return f"⚠️ 未来{days}天{destination}天气不太适合出行"
updated timestamp in the responseThe weather API supports most cities and districts in China, including:
Weekly Installs
402
Repository
GitHub Stars
21
First Seen
Feb 9, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
opencode368
github-copilot367
codex363
gemini-cli362
cursor361
kimi-cli356
Skills CLI 使用指南:AI Agent 技能包管理器安装与管理教程
19,000 周安装
品牌声音准则生成工具 - 从文档、对话和报告自动创建LLM就绪的品牌指南
311 周安装
Axiom 仪表板构建指南:设计决策优先的监控仪表板与数据可视化
311 周安装
Google Ads Manager 技能:广告系列管理、关键词研究、出价优化与效果分析
311 周安装
Telegram机器人开发教程:构建AI助手、通知系统与群组自动化工具
311 周安装
AI图像生成提示词优化指南:DALL-E、Midjourney、Stable Diffusion提示工程技巧
311 周安装
AI协作头脑风暴工具 - 将想法转化为完整设计规范,支持代码模板与项目管理
311 周安装