2
0
Fork 0
forked from zynk/zynk

Wikipedia search command (!wp), version 0.43.0

- Add !wp <search terms> command: searches Wikipedia via MediaWiki API
  (action=query&list=search), displays article titles, snippets, and links.
  Single-result mode fetches the first chapter via Extracts API (exchars=800);
  multi-result mode shows a numbered list with short snippets and per-result
  Read full article links.
- Add self-contained JSON parser helpers: wp_json_get_string(),
  wp_json_next_array_item(), wp_decode_json_string() with \uXXXX Unicode
  support.
- Add wp_url_encode() (RFC 3986), wp_codepoint_to_utf8(), wp_strip_html(),
  wp_collapse_spaces(), wp_hex_digit().
- Add WITH_WP CMake feature toggle (ON by default, HAS_CMD_WP compile def).
- Add !wp to the !help command listing.
- Add doc comments to all 9 functions in cmd_wp.h.
- Update CHANGELOG.md with 0.43.0 entry.
- Update README.md: add Wikipedia to features list, feature toggles table,
  IRC commands utilities table, and minimal build command.
This commit is contained in:
Johannes Findeisen 2026-07-26 00:23:38 +02:00
commit 19b07fa76f
7 changed files with 443 additions and 5 deletions

View file

@ -104,6 +104,10 @@ int cmd_help(Session *s, const char *msg, const char *reply_target, const char *
n = snprintf(p, rem, " !yt <url>,");
p += n; rem -= n;
#endif
#ifdef HAS_CMD_WP
n = snprintf(p, rem, " !wp <query>,");
p += n; rem -= n;
#endif
#ifdef HAS_CMD_QUIT
n = snprintf(p, rem, " !quit/!die (ops)");
p += n; rem -= n;