← 返回
未分类 Key 中文

Screenshot Telegram Direct

Capture website screenshots and send to Telegram via direct API. Works around OpenClaw's broken image delivery (issue
抓取网页截图并通过直接 API 发送至 Telegram,绕过 OpenClaw 损坏的图片传输问题。
niccoreyes niccoreyes 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 需要
★ 0
Stars
📥 325
下载
💾 0
安装
1
版本
#latest

概述

Screenshot → Telegram (Direct)

Capture website screenshots and send them to Telegram, bypassing OpenClaw's broken image delivery pipeline.

Quick Start

# 1. Setup environment
cp .env.example .env
# Edit .env with your tokens

# 2. Run the helper script
./screenshot-send.sh https://github.com

Setup

1. Get API Credentials

Telegram Bot Token:

  • Message @BotFather
  • Send /mybots → Select bot → Copy API token

Telegram Chat ID:

Snap API Key:

# Register for free API key
curl -s -X POST https://snap.llm.kaveenk.com/api/register \
  -H "Content-Type: application/json" \
  -d '{"name":"my-agent"}'
# Save the "key" from response

2. Configure

cp .env.example .env
# Edit .env:
# TELEGRAM_BOT_TOKEN=your_token
# TELEGRAM_CHAT_ID=your_chat_id
# SNAP_API_KEY=your_snap_key

# Source it (temporary)
source .env

3. Auto-Load .env (Recommended for OpenClaw)

Option A: Add to shell profile (always available)

Add to ~/.bashrc or ~/.zshrc:

# Auto-load screenshot-telegram-direct env vars
SKILL_DIR="$HOME/.openclaw/workspace/skills/screenshot-telegram-direct"
if [ -f "$SKILL_DIR/.env" ]; then
    export $(grep -v '^#' "$SKILL_DIR/.env" | xargs)
fi

Then reload: source ~/.bashrc

Option B: Source before each OpenClaw session

In your OpenClaw workspace, create load-env.sh:

#!/bin/bash
source "$HOME/.openclaw/workspace/skills/screenshot-telegram-direct/.env"
echo "✅ Environment loaded from screenshot-telegram-direct/.env"

Run before using: source load-env.sh

Option C: Modify screenshot-send.sh to auto-source

The script already checks for env vars. To auto-source .env if it exists, add at the top:

# Auto-source .env if it exists in script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if [ -f "$SCRIPT_DIR/.env" ]; then
    source "$SCRIPT_DIR/.env"
fi

3. Make Script Executable

chmod +x screenshot-send.sh

Usage

Basic screenshot

./screenshot-send.sh https://example.com

Custom caption

./screenshot-send.sh https://github.com "Latest PR status"

Multiple URLs

for url in "https://github.com" "https://news.ycombinator.com"; do
  ./screenshot-send.sh "$url"
  sleep 2
done

Configuration Options

Snap API Options

Edit screenshot-send.sh to customize:

# Full page screenshot
curl -s -X POST "https://snap.llm.kaveenk.com/api/screenshot" \
  -H "Authorization: Bearer $SNAP_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "url": "'$URL'",
    "full_page": true,
    "width": 1920,
    "height": 1080,
    "dark_mode": true,
    "wait_ms": 2000
  }' \
  -o "$OUTPUT_FILE"
OptionDescription
---------------------
full_pageCapture entire scrollable page
width/heightViewport size
dark_modeEmulate dark color scheme
wait_msWait for JS rendering
formatpng or jpeg

Send as Document (No Compression)

Replace sendPhoto with sendDocument in the script:

curl -s -X POST \
  -F "chat_id=$CHAT_ID" \
  -F "document=@$OUTPUT_FILE" \
  -F "caption=$CAPTION" \
  "https://api.telegram.org/bot$TOKEN/sendDocument"

Automation (Cron)

# Daily dashboard screenshot
0 9 * * * cd /home/pi/.openclaw/workspace/skills/screenshot-telegram-direct && ./screenshot-send.sh https://status.example.com

# Hourly monitoring
0 * * * * cd /home/pi/.openclaw/workspace/skills/screenshot-telegram-direct && ./screenshot-send.sh https://uptime.example.com

File Structure

screenshot-telegram-direct/
├── SKILL.md              # This documentation
├── .env.example          # Template for env vars
├── .env                  # Your secrets (gitignored)
├── .gitignore            # Excludes .env
└── screenshot-send.sh    # Main script

Security

  • .env is gitignored — never commit secrets
  • .env.example shows required variables without values
  • ✅ Script fails if env vars are missing
  • ✅ No hardcoded credentials

Troubleshooting

IssueFix
------------
Missing environment variablesCheck .env exists and is sourced
Failed to capture screenshotCheck SNAP_API_KEY is valid
chat not foundVerify TELEGRAM_CHAT_ID
bot was blockedSend /start to bot in Telegram

Why Not Use OpenClaw Native?

See OpenClaw issue #63137: Images sent via read tool render locally but never reach mobile clients — silent failure with no error logs.

This skill bypasses OpenClaw's Telegram channel entirely using direct HTTP API calls.

Publishing Notes

This skill is ready for publication:

  • No hardcoded secrets
  • .env.example for configuration
  • .gitignore excludes secrets
  • Clear documentation
  • MIT licensed

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-07 22:41 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 680 📥 328,652
dev-programming

CodeConductor.ai

larsonreever
AI驱动平台,提供快速全栈开发、智能体、工作流自动化及低代码AI集成的可扩展产品创建。
★ 73 📥 182,221
dev-programming

YouTube

byungkyu
使用托管OAuth集成YouTube Data API,支持搜索视频、管理播放列表、获取频道数据及评论互动,适用于用户需要时使用此技能。
★ 142 📥 41,768