https://github.com/nullscreen/yt-annotations
Fetch annotations and cards from YouTube videos
https://github.com/nullscreen/yt-annotations
gem
Last synced: 8 months ago
JSON representation
Fetch annotations and cards from YouTube videos
- Host: GitHub
- URL: https://github.com/nullscreen/yt-annotations
- Owner: nullscreen
- License: mit
- Created: 2016-01-04T12:49:53.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2019-11-25T20:31:27.000Z (about 6 years ago)
- Last Synced: 2025-03-30T12:34:42.382Z (9 months ago)
- Topics: gem
- Language: Ruby
- Size: 53.7 KB
- Stars: 9
- Watchers: 9
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: MIT-LICENSE
Awesome Lists containing this 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](https://github.com/fullscreen/yt-annotations) and the **documentation** on [RubyDoc](http://www.rubydoc.info/github/fullscreen/yt-annotations/Yt/Annotations).
[](https://travis-ci.org/Fullscreen/yt-annotations)
[](https://coveralls.io/r/Fullscreen/yt-annotations)
[](https://gemnasium.com/Fullscreen/yt-annotations)
[](https://codeclimate.com/github/Fullscreen/yt-annotations)
[](http://www.rubydoc.info/gems/yt-annotations/Yt/Annotations)
[](http://rubygems.org/gems/yt-annotations)
How to use
==========
Simply call `Yt::Annotations.for` with the ID of a YouTube video:
```ruby
annotations = Yt::Annotations.for 'MESycYJytkU'
# => [#]
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`