Add !yt YouTube title lookup command via oEmbed API. (0.41.0)
Added new !yt command (cmd_yt.h) that fetches the title and channel name of a YouTube video using the YouTube oEmbed API. The video URL is percent-encoded via a new yt_url_encode() helper before being passed as a query parameter. The JSON response is parsed for 'title' and 'author_name' fields using the existing json_find() helper, and the result is formatted as 'Title - Channel'. - New file: cmd_yt.h with yt_url_encode() and cmd_yt() command handler - CMakeLists.txt: added WITH_YT feature toggle (ON by default) - zynk.c: added conditional #include for cmd_yt.h - irc.h: added cmd_yt() dispatch in handle_privmsg() - cmd_help.h: added !yt <url> to the help listing - zynk.c: added doc comments to json_find() function - cmd_yt.h: added doc comments to yt_url_encode() and cmd_yt() - CHANGELOG.md: added 0.41.0 entry documenting all changes - README.md: updated feature summary, features list, feature toggles table, minimal build command, and IRC commands utilities table
This commit is contained in:
parent
084a41cfbd
commit
d59d4dc46c
7 changed files with 186 additions and 27 deletions
|
|
@ -1,6 +1,6 @@
|
|||
cmake_minimum_required(VERSION 3.13)
|
||||
|
||||
project(zynk VERSION 0.40.9 LANGUAGES C)
|
||||
project(zynk VERSION 0.41.0 LANGUAGES C)
|
||||
|
||||
# Prefer C99; the code is compatible with C99/C11
|
||||
set(CMAKE_C_STANDARD 99)
|
||||
|
|
@ -29,6 +29,7 @@ option(WITH_REBUILD "Rebuild command (ops only)" OFF)
|
|||
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_GREETING_OR_CHAT "Greeting/chat with AI fallback" ON)
|
||||
|
||||
# Map WITH_* options to HAS_CMD_* compile definitions and print feature status
|
||||
|
|
@ -37,7 +38,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 GREETING_OR_CHAT)
|
||||
REBUILD UPTIME RELOAD RESTART YT 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