Ruby wrapper for the Holodex API.
- Obtain an API key.
gem install holodex
require 'holodex'
holodex = Holodex.new(ENV['HOLODEX_API_KEY'])
Each resource is represented by a method. Please refer to the documentation for the parameters that can be passed. The following sections show minimal examples how one might query the API with the aforementioned methods.
holodex.live(channel_id: 'UCL_qhgtOy0dy1Agp8vkySQg', status: 'upcoming')
holodex.videos(org: 'Hololive', topic: 'singing')
holodex.channel('UC3n5uGu18FoCy23ggWWp8tA')
holodex.related_videos('UCO_aKKYxn4tvrqPjcTzZ6EQ', 'clips', limit: 3)
holodex.users_live('UCq4ky2drohLT7W0DmDEw1dQ', 'UC3n5uGu18FoCy23ggWWp8tA', 'UC_sFNM0z0MWm9A6WlKPuMMg')
holodex.video('QI96hnhcr2E')
holodex.channels(org: 'Hololive', type: 'vtuber')
holodex.video_search(lang: ['en'], target: ['stream'], topic: ['Pokemon_Unite'], limit: 3)
holodex.comment_search(org: ['Hololive'], comment: ["let's go"], limit: 1)
-
post-search-videoSearch and post-search-commentSearch resources are misdocumented.
sort
,offset
, andlimit
parameters are not required. However, without setting a limit the request will typically timeout.- The
comment
parameter for comment search should be an array of strings.
See this Discord conversation for details.
-
One can trivially affect how parsing is done by overloading the private method #parse.
For example, if one didn't want any response parsing or exception raising done at all:
class Holodex private def parse(response) = response.body end