2
0
Fork 0
forked from zynk/zynk

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:
Johannes Findeisen 2026-07-25 02:17:59 +02:00
commit d59d4dc46c
7 changed files with 186 additions and 27 deletions

View file

@ -1,3 +1,11 @@
2026.07.25 - YouTube title lookup command, json_find docs. (0.41.0)
- Added `!yt <url>` command: fetches the title and channel name of a YouTube video using the YouTube oEmbed API (`https://www.youtube.com/oembed`). 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"`.
- Added `WITH_YT` CMake feature toggle (ON by default) with compile definition `HAS_CMD_YT`.
- Added `!yt` to the `!help` command listing.
- Added comprehensive doc comments to `yt_url_encode()` and `cmd_yt()` in `cmd_yt.h`, and to `json_find()` in `zynk.c`.
- Updated README.md: added YouTube title lookup to the feature summary, features list, feature toggles table, minimal build command, and IRC commands utilities table.
2026.07.24 - Reduced MAX_HISTORY, moved LOAD_FUNC macro, added irc_reply docs. (0.40.9)
- Reduced `MAX_HISTORY` from 100 to 12 to decrease AI context memory usage.