视觉画布设计
canvas-design
基于设计原则创作静态视觉作品,用于海报与品牌图形。
fun-content【文档与办公】Use when a task needs light entertainment content from a live API - "build a quiz/trivia game", "random dog picture", "cat fact", "advice of the day", "random fun fact" - for a demo, bot, party feature, or filler content slot. Open Trivia DB is the quiz default (its session-token mechanics are documented here); catfact.ninja, random.dog, Advice Slip,…
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Pull trivia, animal images, and one-liner facts from verified keyless endpoints. The mistakes this prevents: shipping a quiz that repeats questions because Open Trivia DB's token mechanics were skipped, printing raw HTML entities in questions, and citing one of this category's chronically-dead quote APIs from training memory.
", '). Either decode entities client-side or request &encode=url3986 and URL-decode - do one of them, or apostrophes render as garbage.response_code on every trivia call. 0 ok; 1 not enough questions for the filters (loosen category/difficulty); 3/4 token missing or exhausted (request/reset token); 5 rate-limited (wait 5s).correct_answer and incorrect_answers arrive separated - merge and shuffle before display or the correct answer's position leaks..mp4/.webm.Ask the user only if missing - trivia: question count (default: 10), category (default: any), difficulty (default: any).
Trivia session + questions:
https://opentdb.com/api_token.php?command=request ← once per user session
https://opentdb.com/api.php?amount=10&type=multiple&token={token}
https://opentdb.com/api.php?amount=10&category=9&difficulty=easy&token={token} ← 9 = General Knowledge
https://opentdb.com/api_category.php ← id → name list
https://opentdb.com/api_token.php?command=reset&token={token} ← on response_code 4
{"response_code":0,"results":[{"type":"multiple","difficulty":"easy",
"category":"Entertainment: Musicals & Theatres",
"question":"In Shakespeare's play Julius Caesar, Caesar's last words were...",
"correct_answer":"Et tu, Brute? ",
"incorrect_answers":["Iacta alea est!","Vidi, vini, vici.","Aegri somnia vana."]}]}
Tokens expire after 6 hours of inactivity. Max amount=50 per call.
One-liners and animals:
https://catfact.ninja/fact → {"fact":"...","length":94}
https://random.dog/woof.json → {"url":"https://random.dog/….jpg","fileSizeBytes":170059}
https://api.adviceslip.com/advice → {"slip":{"id":89,"advice":"Don't be afraid to ask questions."}}
https://api.adviceslip.com/advice/search/{q} → {"slips":[...]} - 404s (JSON body) on no match
https://uselessfacts.jsph.pl/api/v2/facts/random → {"text":"...","source":"...","permalink":"..."}
Advice Slip caches responses for ~2 seconds - identical repeat calls return the same slip; don't build "another one!" loops tighter than that.
For a quiz: working token lifecycle (request → use → reset on code 4), entity-decoded questions, shuffled answers, response_code handled. For content slots: the fetched item plus the URL used, with image extensions filtered where the API mixes media types.
" or ' ever reaches the user.response_code paths are handled, not assumed zero.Sourced and liveness-verified from the public-apis project (MIT).