tw93/Waza / plugins/waza/skills/read
read
VerifiedFetches URLs and PDFs, then summarizes or returns clean Markdown; can also search the web through DeepSeek when built-in search is thin. Use when asked to read, fetch, quote, cite, convert, or save a URL or PDF. Not for local text files already in the repo.
| File | Kind | Size |
|---|---|---|
| SKILL.md | skill md | 7.7 KB |
| references/read-methods.md | markdown | 5.2 KB |
| scripts/deepseek.py | script | 3.9 KB |
| scripts/fetch.sh | script | 3.9 KB |
| scripts/fetch_feishu.py | script | 8.9 KB |
| scripts/fetch_local.py | script | 7.1 KB |
| scripts/fetch_weixin.py | script | 3.6 KB |
scripts/fetch.sh
View on GitHub#!/usr/bin/env bash
# Fetch a URL as Markdown.
#
# Privacy-first cascade:
# Default (no --use-proxy): local extractor only. URL is never sent to a
# third party. Best quality when readability-lxml + html2text are pip-
# installed; degrades to a stdlib-only stripper otherwise.
#
# With --use-proxy: tries local first, then the DeepSeek Fetch API when
# DEEPSEEK_API_KEY is set, then defuddle.md, then r.jina.ai.
# Use this for JS-heavy pages, X/Twitter, paywalls, or anything the local
# extractor cannot reach. Be aware: the URL is sent to those third-party
# services and may be cached or logged. Never feed sensitive URLs through
# --use-proxy.
#
# Every tier writes a structured stderr line:
# [fetch] tier=<local|defuddle|jina> status=<ok|fail|skip> reason="..."
#
# Special thanks to joeseesun for the qiaomu-markdown-proxy project, which
# inspired the proxy cascade design:
# https://github.com/joeseesun/qiaomu-markdown-proxy
#
# Usage:
# fetch.sh <url> [proxy_url]
# fetch.sh --use-proxy <url> [proxy_url]
set -euo pipefail
USE_PROXY=0
if [ "${1:-}" = "--use-proxy" ]; then
USE_PROXY=1
shift
fi
URL="${1:?Usage: fetch.sh [--use-proxy] <url> [proxy_url]}"
PROXY="${2:-}"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
LOCAL_ERR="$(mktemp)"
trap 'rm -f "$LOCAL_ERR"' EXIT
# shellcheck disable=SC2329,SC2317 # called indirectly via _with_retry / _try_once
_curl() {
if [ -n "$PROXY" ]; then
https_proxy="$PROXY" http_proxy="$PROXY" curl -sfL --connect-timeout 10 --max-time 30 "$@"
else
curl -sfL --connect-timeout 10 --max-time 30 "$@"
fi
}
_has_content() {
local content="$1"
[ "$(printf '%s' "$content" | wc -l)" -gt 5 ] || return 1
# Reject pages dominated by login walls, captchas, or bot challenges that
# otherwise pass the line-count check. Add new markers here, not new branches.
if printf '%s' "$content" | grep -qE "Don't miss what's happening|Sign in to continue|Please sign in|Log in to continue|请登录|登录后查看|机器人验证|人机验证|Just a moment\.\.\.|Checking your browser|requiring CAPTCHA" 2>/dev/null; then
return 1
fi
return 0
}
_try_once() {
local out
out=$("$@" 2>/dev/null || true)
if _has_content "$out"; then echo "$out"; return 0; fi
return 1
}
_with_retry() {
_try_once "$@" && return 0
sleep 2
_try_once "$@" && return 0
return 1
}
# Tier 1: local extractor. Always tried first.
if OUT=$(python3 "$SCRIPT_DIR/fetch_local.py" "$URL" 2>"$LOCAL_ERR"); then
cat "$LOCAL_ERR" >&2 2>/dev/null || true
echo "$OUT"
exit 0
fi
cat "$LOCAL_ERR" >&2 2>/dev/null || true
# Without --use-proxy, stop here. No third-party extraction service is used.
if [ "$USE_PROXY" -eq 0 ]; then
echo "[fetch] status=fail reason=\"local extractor failed; rerun with --use-proxy to try defuddle.md and r.jina.ai (URL will be sent to those services)\"" >&2
exit 1
fi
# Tier 2: DeepSeek Fetch API, only when the user has a DEEPSEEK_API_KEY
# (third party, billed per request; user opted in via --use-proxy).
if [ -n "${DEEPSEEK_API_KEY:-}" ]; then
if OUT=$(python3 "$SCRIPT_DIR/deepseek.py" fetch "$URL" 2>/dev/null) && _has_content "$OUT"; then
echo "[fetch] tier=deepseek status=ok" >&2
echo "$OUT"
exit 0
fi
echo "[fetch] tier=deepseek status=fail reason=\"empty, error, or paywall-like response\"" >&2
fi
# Tier 3: defuddle.md (third party; user opted in via --use-proxy).
if OUT=$(_with_retry _curl "https://defuddle.md/$URL"); then
echo "[fetch] tier=defuddle status=ok" >&2
echo "$OUT"
exit 0
fi
echo "[fetch] tier=defuddle status=fail reason=\"empty or paywall-like response\"" >&2
# Tier 4: r.jina.ai (third party; user opted in via --use-proxy).
if OUT=$(_with_retry _curl "https://r.jina.ai/$URL"); then
echo "[fetch] tier=jina status=ok" >&2
echo "$OUT"
exit 0
fi
echo "[fetch] tier=jina status=fail reason=\"empty or paywall-like response\"" >&2
echo "[fetch] status=fail reason=\"every tier failed for $URL\"" >&2
exit 1
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| canvas-designanthropics/skillsCreate beautiful visual art in .png and .pdf documents using design philosophy. You should use this skill when the user asks to create a poster, piece of art, design, or other static piece. Create original visual designs, never copying existing artists' work to avoid copyright violations. | Stars: 195k | Updated | Claude CodeCodex | Verified | Install |
| docxanthropics/skillsUse this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include: any mention of 'Word doc', 'word document', '.docx', '.dotx', or requests to produce professional documents with formatting like tables of contents, headings, page numbers, or letterheads. Also use when extracting or reorganizing content from .docx or .dotx files, inserting or replacing images in documents, performing find-and-replace in Word files, working with tracked changes or comments, or converting content into a polished Word document. If the user asks for a 'report', 'memo', 'letter', 'template', or similar deliverable as a Word or .docx file, use this skill. Do NOT use for PDFs, spreadsheets, Google Docs, or general coding tasks unrelated to document generation. | Stars: 195k | Updated | Claude CodeCodex | Verified | Install |
| pdfanthropics/skillsUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple PDFs into one, splitting PDFs apart, rotating pages, adding watermarks, creating new PDFs, filling PDF forms, encrypting/decrypting PDFs, extracting images, and OCR on scanned PDFs to make them searchable. If the user mentions a .pdf file or asks to produce one, use this skill. | Stars: 195k | Updated | Claude CodeCodex | Verified | Install |
| pptxanthropics/skillsUse this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or presentations; reading, parsing, or extracting text from any .pptx or .potx file (even if the extracted content will be used elsewhere, like in an email or summary); editing, modifying, or updating existing presentations; combining or splitting slide files; working with templates (.potx), layouts, speaker notes, or comments. Trigger whenever the user mentions "deck," "slides," "presentation," or references a .pptx or .potx filename, regardless of what they plan to do with the content afterward. If a .pptx or .potx file needs to be opened, created, or touched, use this skill. | Stars: 195k | Updated | Claude CodeCodex | Verified | Install |