https://github.com/nullscreen/yt-audit
https://github.com/nullscreen/yt-audit
gem
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nullscreen/yt-audit
- Owner: nullscreen
- License: mit
- Created: 2016-02-09T01:16:11.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2019-08-16T01:05:26.000Z (almost 6 years ago)
- Last Synced: 2025-02-22T09:47:34.103Z (4 months ago)
- Topics: gem
- Language: Ruby
- Size: 57.6 KB
- Stars: 2
- Watchers: 26
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: MIT-LICENSE
Awesome Lists containing this project
README
# Yt::Audit
Welcome! This is a Ruby library you can audit best practices of a YouTube channel.
The **source code** is available on [GitHub](https://github.com/Fullscreen/yt-audit) and the **documentation** on [RubyDoc](http://www.rubydoc.info/github/fullscreen/yt-audit/master/Yt/Audit).
[](https://travis-ci.org/Fullscreen/yt-audit)
[](https://coveralls.io/r/Fullscreen/yt-audit)
[](https://gemnasium.com/Fullscreen/yt-audit)
[](https://codeclimate.com/github/Fullscreen/yt-audit)
[](http://www.rubydoc.info/github/fullscreen/yt-audit/master/Yt/Audit)
[](http://rubygems.org/gems/yt-audit)## Development
$ bin/setup
$ YT_SERVER_API_KEY="123456789012345678901234567890123456789" rake
$ open coverage/index.html$ yardoc
$ open doc/index.html## Usage
`run` method returns an array of objects. `Yt::Audit` should be initialized with a `Yt::Channel` object of [yt](https://github.com/Fullscreen/yt) as `channel`.
It can also have videos, brand name, and playlists as optional, but by default it uses maximum 10 recent videos of channel as `videos`, channel title as `brand` and maximum 10 recent playlists as `playlists` keyword argument.
```ruby
channel = Yt::Channel.new(id: 'UCPCk_8dtVyR1lLHMBEILW4g')
audit = Yt::Audit.new(channel: channel)
# => #, @videos=[...], @playlists=[...], @brand="budweiser">
audit.run
# => [#, #, #, #, #, #]
```You can call four available methods `total_count`, `valid_count`, `title`, and `description` from each `Yt::VideoAudit` or `Yt::PlaylistAudit` object.
```ruby
audit_item = audit.run[0]
# => #
audit_item.total_count
# => 10
audit_item.valid_count
# => 10
audit_item.title
# => "Info Cards"
audit_item.description
# => "The number of videos with an info card"
```