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/deepseek.py
View on GitHub#!/usr/bin/env python3
"""Web search and page fetch through the DeepSeek Search/Fetch API.
Opt-in third-party tier: the query or URL is sent to DeepSeek and billed per
successful request. Needs DEEPSEEK_API_KEY; without it the script exits 2 and
nothing leaves the machine.
Usage:
deepseek.py search "<query>" [--count N] [--content] [--json]
deepseek.py fetch <url> [--json]
Every run writes one structured stderr line:
[fetch] tier=deepseek status=<ok|fail> reason="..."
"""
import argparse
import json
import os
import sys
import urllib.error
import urllib.request
API = "https://api.deepseek.com/v1/tools/"
TIMEOUT = 60
def log(status, reason=""):
suffix = f' reason="{reason}"' if reason else ""
print(f"[fetch] tier=deepseek status={status}{suffix}", file=sys.stderr)
def call(endpoint, body, key):
req = urllib.request.Request(
API + endpoint,
data=json.dumps(body).encode(),
headers={"Authorization": f"Bearer {key}", "Content-Type": "application/json"},
)
with urllib.request.urlopen(req, timeout=TIMEOUT) as resp:
return json.loads(resp.read())
def api_error(exc):
try:
return json.loads(exc.read())["error"]["message"]
except Exception:
return f"HTTP {exc.code}"
def render_search(results):
if not results:
return "No results."
lines = []
for n, r in enumerate(results, 1):
meta = [r.get("site_name") or "", (r.get("date") or "")[:10]]
if r.get("authority", -1) >= 0:
meta.append(f"authority {r['authority']}")
if r.get("rerank_score") is not None:
meta.append(f"score {r['rerank_score']:.2f}")
lines.append(f"{n}. {r.get('title') or '(untitled)'}")
lines.append(f" {r.get('url', '')}")
lines.append(" " + " · ".join(m for m in meta if m))
text = (r.get("summary") or r.get("snippet") or "").strip()
if text:
lines.append(" " + " ".join(text.split()))
if r.get("content"):
lines.append("")
lines.append(r["content"].strip())
lines.append("")
return "\n".join(lines).rstrip()
def render_fetch(url, data):
title = data.get("title") or ""
head = f"# {title}\n\nSource: {url}\n\n" if title else f"Source: {url}\n\n"
return head + (data.get("content") or "").strip()
def main(argv=None):
parser = argparse.ArgumentParser(description=__doc__.split("\n\n")[0])
sub = parser.add_subparsers(dest="cmd", required=True)
s = sub.add_parser("search")
s.add_argument("query")
s.add_argument("--count", type=int, default=10)
s.add_argument("--content", action="store_true", help="include page bodies")
s.add_argument("--json", action="store_true")
f = sub.add_parser("fetch")
f.add_argument("url")
f.add_argument("--json", action="store_true")
args = parser.parse_args(argv)
key = os.environ.get("DEEPSEEK_API_KEY", "").strip()
if not key:
log("skip", "DEEPSEEK_API_KEY is not set")
return 2
if args.cmd == "search":
if not 1 <= len(args.query) <= 128:
log("fail", "query must be 1-128 characters")
return 2
body = {"query": args.query, "count": max(1, min(args.count, 50))}
if args.content:
body["need_content"] = True
else:
body = {"url": args.url}
try:
data = call(args.cmd, body, key)
except urllib.error.HTTPError as exc:
log("fail", api_error(exc))
return 1
except (urllib.error.URLError, TimeoutError, OSError, ValueError) as exc:
log("fail", type(exc).__name__)
return 1
if args.json:
print(json.dumps(data, ensure_ascii=False, indent=1))
elif args.cmd == "search":
print(render_search(data.get("results", [])))
else:
print(render_fetch(args.url, data))
log("ok")
return 0
if __name__ == "__main__":
sys.exit(main())
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 |