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
3
irc.h
3
irc.h
|
|
@ -414,6 +414,9 @@ static void handle_privmsg(Session *s, const char *params, const char *src_nick)
|
|||
#ifdef HAS_CMD_RESTART
|
||||
if (cmd_restart(s, msg, reply_target, src_nick, tgt)) return;
|
||||
#endif
|
||||
#ifdef HAS_CMD_YT
|
||||
if (cmd_yt(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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue