mirror of
https://github.com/only-cli/oc.git
synced 2026-09-15 10:40:56 +02:00
Article, search, and non English wiki lookups via clis/wikipedia.org.json, reachable as oc wiki, oc wikipedia, or oc wikipedia.org. The article and lang commands use ?action=render, which returns the article HTML without the interlanguage sidebar and Tools menu that otherwise eat about half of a 500 token budget before any prose. Its links stay root relative, so oc do <n> still follows them; the Parsoid endpoints render just as clean but emit ./Title hrefs that resolve against the API path and break link following. Search uses the normal results page. The api.php JSON search endpoint is cheaper on paper but distills to nothing today, since its results sit in a nested query.search array. Closes #21
9 lines
406 B
JSON
9 lines
406 B
JSON
{
|
|
"domain": "wikipedia.org",
|
|
"commands": {
|
|
"article": { "open": "https://en.wikipedia.org/w/index.php?title={title}&action=render", "args": ["title"] },
|
|
"search": { "open": "https://en.wikipedia.org/w/index.php?search={query}&fulltext=1&ns0=1", "args": ["query"] },
|
|
"lang": { "open": "https://{code}.wikipedia.org/w/index.php?title={title}&action=render", "args": ["code", "title"] }
|
|
}
|
|
}
|