Skip to content

Akseluhreyter/holodex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ruby wrapper for the Holodex API.

Table of Contents

Getting Started

  1. Obtain an API key.
  2. gem install holodex

Usage

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.

Query Live and Upcoming Videos

holodex.live(channel_id: 'UCL_qhgtOy0dy1Agp8vkySQg', status: 'upcoming')

Query Videos

holodex.videos(org: 'Hololive', topic: 'singing')

Query Channel Information

holodex.channel('UC3n5uGu18FoCy23ggWWp8tA')

Query Videos Related to Channel

holodex.related_videos('UCO_aKKYxn4tvrqPjcTzZ6EQ', 'clips', limit: 3)

Quickly Access Live Upcoming for a set of Channels

holodex.users_live('UCq4ky2drohLT7W0DmDEw1dQ', 'UC3n5uGu18FoCy23ggWWp8tA', 'UC_sFNM0z0MWm9A6WlKPuMMg')

Get a single Video's metadata

holodex.video('QI96hnhcr2E')

List Channels

holodex.channels(org: 'Hololive', type: 'vtuber')

post-search-videoSearch

holodex.video_search(lang: ['en'], target: ['stream'], topic: ['Pokemon_Unite'], limit: 3)

post-search-commentSearch

holodex.comment_search(org: ['Hololive'], comment: ["let's go"], limit: 1)

Notes

  • post-search-videoSearch and post-search-commentSearch resources are misdocumented.

    1. sort, offset, and limit parameters are not required. However, without setting a limit the request will typically timeout.
    2. 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

Releases

No releases published

Packages

No packages published

Languages