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:
parent
4dbdd9bdde
commit
19b07fa76f
7 changed files with 443 additions and 5 deletions
|
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
project(zynk VERSION 0.42.0 LANGUAGES C)
|
||||
project(zynk VERSION 0.43.0 LANGUAGES C)
|
||||
|
||||
# Prefer C99; the code is compatible with C99/C11
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
|
@ -30,6 +30,7 @@ option(WITH_UPTIME "Uptime command" ON)
|
|||
option(WITH_RELOAD "Hot-reload command (ops only)" ON)
|
||||
option(WITH_RESTART "Restart command (ops only)" ON)
|
||||
option(WITH_YT "YouTube title command (requires curl)" ON)
|
||||
option(WITH_WP "Wikipedia search command (requires curl)" ON)
|
||||
option(WITH_GREETING_OR_CHAT "Greeting/chat with AI fallback" ON)
|
||||
|
||||
# Map WITH_* options to HAS_CMD_* compile definitions and print feature status
|
||||
|
|
@ -38,7 +39,7 @@ message(STATUS "Feature configuration for zynk (${PROJECT_VERSION}):")
|
|||
message(STATUS "=============================================================================")
|
||||
foreach(_feat ZYNK PING VERSION HELP QUIT WEATHER FORECAST STOCK
|
||||
CALC TIME SEEN TELL GITLOG CHANGELOG AI CODE
|
||||
REBUILD UPTIME RELOAD RESTART YT GREETING_OR_CHAT)
|
||||
REBUILD UPTIME RELOAD RESTART YT WP GREETING_OR_CHAT)
|
||||
string(TOLOWER "${_feat}" _feat_lower)
|
||||
if(WITH_${_feat})
|
||||
list(APPEND _cmd_defs "HAS_CMD_${_feat}")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue