0.01
No commit activity in last 3 years
No release in over 3 years
A Ruby library to retrieve every type of annotation from any YouTube video, including branding, featured content and info cards.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.14
~> 0.8.20
~> 0.2.4
~> 12.0
~> 3.5
~> 0.9.8

Runtime

< 6, >= 4
 Project Readme

A Ruby gem to fetch YouTube annotations

Yt::Annotations is a Ruby library to fetch annotations, cards and end screens of YouTube videos.

The source code is available on GitHub and the documentation on RubyDoc.

Build Status Coverage Status Dependency Status Code Climate Online docs Gem Version

How to use

Simply call Yt::Annotations.for with the ID of a YouTube video:

annotations = Yt::Annotations.for 'MESycYJytkU'
# => [#<Yt::Annotations::Featured …>]
annotations.first.text
# => "Suggested by Fullscreen: What is Fullscreen?"
annotations.first.starts_at
# => 76.0
annotations.first.ends_at
# => 86.0
annotations.first.link
# {url: "https://www.youtube.com/watch?v=NeMlqbX2Ifg", new_window: true, type: :video}

How to install

Yt::Annotations requires Ruby 2.2.2 or higher.

To include in your project, add gem 'yt-annotations', ~> '1.0' to the Gemfile file of your Ruby project.

How to contribute

Contribute to the code by forking the project, adding the missing code, writing the appropriate tests and submitting a pull request.

In order for a PR to be approved, all the tests need to pass and all the public methods need to be documented and listed in the guides. Remember:

  • to run all tests locally: bundle exec rspec
  • to generate the docs locally: bundle exec yard
  • to list undocumented methods: bundle exec yard stats --list-undoc