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
|
|
@ -100,6 +100,10 @@ int cmd_help(Session *s, const char *msg, const char *reply_target, const char *
|
|||
n = snprintf(p, rem, " !restart (ops),");
|
||||
p += n; rem -= n;
|
||||
#endif
|
||||
#ifdef HAS_CMD_YT
|
||||
n = snprintf(p, rem, " !yt <url>,");
|
||||
p += n; rem -= n;
|
||||
#endif
|
||||
#ifdef HAS_CMD_QUIT
|
||||
n = snprintf(p, rem, " !quit/!die (ops)");
|
||||
p += n; rem -= n;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue