360 Secure SkillHub
360 安全技能中心

Weather & Webcam

先用 wttr.in 获取指定地点的当前天气,再用 agent-browser 在 Meteoblue 或 Windy 上定位该地点的摄像头页面,处理 Cookie 弹窗并提取高清图片,下载到本地后作为消息媒体连同天气信息一起发送给用户。依赖 openclaw 运行环境与 agent-browser、curl。

alex1389
alex1389
热度 46.34
最近更新 2026-03-16 12:16:59
分类:生活依赖:联网浏览搜索 / 读写文件 / 第三方 API / 代码执行应用场景:旅行 / 工作流 / 自动化脚本

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add weather-location
Metadata
name
Weather&Webcam
description
Fetches current weather from wttr.in and automatically captures a live webcam image from Meteoblue or Windy for the requested location. Use it when the user asks for the weather and wants to see a real image of the current conditions.
metadata
{"openclaw":{"requires":{"bins":["agent-browser","curl"]}}}

Weather Location

This skill automates weather data retrieval and live webcam image capture using agent-browser for maximum quality.

Workflow

  1. Get weather (wttr.in):

    • Execute curl -s "wttr.in/[Location]?format=%l:+%c+%t+%h+%w" to get basic data.
    • Note: Encode spaces (e.g., Sant+Adria+de+Besos).
  2. Search for Webcam:

    • Web search for site:meteoblue.com [Location] webcam or site:windy.com [Location] webcam.
    • Select the direct link to the location's webcam page.
  3. Capture Image (Agent Browser Method):

    • Use agent-browser to navigate and interact:
      /home/user/.npm-global/bin/agent-browser --session-name webcam open "[URL]"
      
    • Interaction:
      • Click "OK/Accept" on cookie banners using snapshot + click @ref.
      • Click the specific location link to open the large view/gallery.
    • Extraction:
      • Use eval to find the highest resolution URL (look for /full/ and original.jpg):
        Array.from(document.querySelectorAll('img')).map(img => img.src).filter(src => src.includes('original.jpg') && src.includes('/full/'))[0]
        
    • Download:
      • Download with curl to /home/user/.openclaw/workspace/webcam.jpg.
  4. User Response:

    • Send with message(action=send, media="/home/user/.openclaw/workspace/webcam.jpg", caption="[wttr.in data]\n[Comment]").
    • Respond with NO_REPLY.

Optimization (Token Saving)

  1. Agent Browser: Priority method for Alex to ensure interaction (cookies) and high-quality images.
  2. Session Persistence: Use --session-name webcam to keep cookies.
  3. Scrapling (Fallback): Use only if agent-browser fails.

Usage Examples

  • "What's the weather like in London?"
  • "Show me the webcam in Barcelona"
  • "How's the sky in Vilassar de Mar?"