Goal: Fetch a current image from a saved favorites list (number -> webcam page) and send it to the user.
Default file in the workspace:
docs/webcams/favorites-muenchen.jsonFormat:
items[].id (int)items[].name (string)items[].page (URL of the webcam page)items[].image (direct image URL)1) Load favorites list from docs/webcams/favorites-muenchen.json.
2) Find entry with id equal to N.
3) Fetch snapshot:
4) Save image to /tmp/webcamN.jpg
5) Send image via openclaw CLI:
openclaw message send --channel telegram --target
Maximum 6 images per request; ask first if more are requested.
Run a separate openclaw call for each ID — never bundle multiple images into a single command or response.
Example for “webcam 1+3”:
python3 ... --id 1 --out /tmp/webcam1.jpg
-> read name from script output
openclaw message send --channel telegram --target
python3 ... --id 3 --out /tmp/webcam3.jpg
-> read name from script output
openclaw message send --channel telegram --target
Each openclaw command runs separately. The caption for each image comes exclusively from the script output (field “name”) of the respective call.
Send a plain text list:
Webcam 1 Name
Webcam 2 Name
etc.
No formatting, plain text only.
For a webcam page like:
https://www.foto-webcam.eu/webcam/zugspitze/there is usually a direct “current” image at:
https://www.foto-webcam.eu/webcam/zugspitze/current/1200.jpgIn practice: fetch the HTML with a browser User-Agent and search for a link matching .../current/.
Use the script:
skills/public/foto-webcam/scripts/foto_webcam_snapshot.pyExamples:
python3 skills/public/foto-webcam/scripts/foto_webcam_snapshot.py --favorites docs/webcams/favorites-muenchen.json --id 4 --out /tmp/webcam4.jpgpython3 skills/public/foto-webcam/scripts/foto_webcam_snapshot.py --url https://www.foto-webcam.eu/webcam/zugspitze/ --out /tmp/zugspitze.jpgfavorites-muenchen.json (new id, name, page).image to a direct JPG link.Important: chat responses must be plain text only (no Markdown). For audio, use clean speech only (no special characters or formatting).
> Eine deutsche Version dieser Skill-Beschreibung ist weiter unten zu finden.
Ziel: Ein aktuelles Bild aus einer gespeicherten Favoritenliste (Nummer → Webcam-Seite) abrufen und an den Benutzer senden.
Standarddatei im Workspace:
docs/webcams/favorites-muenchen.jsonFormat:
items[].id (int)items[].name (string)items[].page (URL der Webcam-Seite)items[].image (direkte Bild-URL)1) Favoritenliste aus docs/webcams/favorites-muenchen.json laden.
2) Eintrag mit der entsprechenden ID finden.
3) Schnappschuss abrufen:
image gesetzt ist: diese URL direkt laden4) Bild unter /tmp/webcamN.jpg speichern
5) Bild per openclaw CLI senden:
openclaw message send --channel telegram --target
Maximal 6 Bilder pro Anfrage; bei mehr zuerst nachfragen.
Für jede ID einen separaten openclaw-Aufruf ausführen — niemals mehrere Bilder in einem einzigen Befehl oder einer Antwort bündeln.
Beispiel für „webcam 1+3":
python3 ... --id 1 --out /tmp/webcam1.jpg
-> Name aus Script-Ausgabe lesen
openclaw message send --channel telegram --target
python3 ... --id 3 --out /tmp/webcam3.jpg
-> Name aus Script-Ausgabe lesen
openclaw message send --channel telegram --target
Jeder openclaw-Befehl läuft separat. Die Bildunterschrift kommt ausschließlich aus der Script-Ausgabe (Feld „name") des jeweiligen Aufrufs.
Einfache Textliste senden:
Webcam 1 Name
Webcam 2 Name
usw.
Keine Formatierung, nur reiner Text.
Für eine Webcam-Seite wie:
https://www.foto-webcam.eu/webcam/zugspitze/gibt es normalerweise ein aktuelles Bild unter:
https://www.foto-webcam.eu/webcam/zugspitze/current/1200.jpgIn der Praxis: HTML mit Browser-User-Agent abrufen und nach einem Link suchen, der auf .../current/ passt.
Das Script verwenden:
skills/public/foto-webcam/scripts/foto_webcam_snapshot.pyBeispiele:
python3 skills/public/foto-webcam/scripts/foto_webcam_snapshot.py --favorites docs/webcams/favorites-muenchen.json --id 4 --out /tmp/webcam4.jpgpython3 skills/public/foto-webcam/scripts/foto_webcam_snapshot.py --url https://www.foto-webcam.eu/webcam/zugspitze/ --out /tmp/zugspitze.jpgfavorites-muenchen.json ergänzen (neue id, name, page).image auf eine direkte JPG-URL setzen.Wichtig: Chat-Antworten nur als reiner Text (kein Markdown). Für Sprachausgabe: sauberer Text ohne Sonderzeichen oder Formatierung.
共 1 个版本