wikid

[discontinued] A quick and simple CLI-program for downloading and rendering wikipedia pages in the terminal.
git clone https://noxz.tech/git/wikid.git
Log | Files | README | LICENSE

config.def.h
1#define LANG_POS    8
2#define _PADDING    3
3
4char language[]         = "en";
5char temp_file[]        = "/tmp/__wikidtmp.XXXXXX";
6
7const Service services[] = {
8    { "wikipedia",      "https://xx.wikipedia.org/w/api.php"
9                        "?format=json"
10                        "&action=query"
11                        "&prop=extracts"
12                        "&exlimit=1"
13                        "&explaintext"
14                        "&redirects"
15                        "&titles="},
16    { "wiktionary",     "https://xx.wiktionary.org/w/api.php"
17                        "?format=json"
18                        "&action=query"
19                        "&prop=extracts"
20                        "&exlimit=1"
21                        "&explaintext"
22                        "&redirects"
23                        "&titles="},
24};
25
26/* cleanup mappings for wikipedia responses
27 * NOTE: the replacement cannot be greater in size than the entity itself. If
28 * it is, it'll just be ignored.
29 */
30const Dictionary cleanup_mappings[] = {
31    /* entity       replacement */
32    { "\\n",        "\n\n" },
33    { "\\t",        "  " },
34    { "\\\"",       "\"" },
35};