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

3
irc.h
View file

@ -431,6 +431,9 @@ static void handle_privmsg(Session *s, const char *params, const char *src_nick)
#ifdef HAS_CMD_YT
if (cmd_yt(s, msg, reply_target, src_nick)) return;
#endif
#ifdef HAS_CMD_WP
if (cmd_wp(s, msg, reply_target, src_nick)) return;
#endif
#ifdef HAS_CMD_GREETING_OR_CHAT
cmd_greeting_or_chat(s, msg, reply_target, src_nick);
#endif