yt-audit 0.2.2 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +11 -1
- data/README.md +6 -3
- data/bin/yt-audit +2 -1
- data/lib/yt/audit.rb +11 -22
- data/lib/yt/audit/version.rb +1 -1
- data/lib/yt/playlist_audit/description.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f7bc9f29587e691fd0f693a570cdcbc39deca4ec
|
4
|
+
data.tar.gz: 022b95848d5c6d63ad818e803623ad430cabbe59
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c1106b3b5308e86c1da812c2534c899ed75118d0db8157a262b317f2a5691a6cbfa3a97274e9bdff6839afdb4c0fb45ffa97adb19e98fd8da0f4664d57941760
|
7
|
+
data.tar.gz: dcae062f93467af330f789d0335e166f5bb89d6600def3952d590f775cc415aeabe9742e378c668b653987c319325b8bff64315afc5541f00f3f647cec1eb0e9
|
data/CHANGELOG.md
CHANGED
@@ -6,9 +6,19 @@ For more information about changelogs, check
|
|
6
6
|
[Keep a Changelog](http://keepachangelog.com) and
|
7
7
|
[Vandamme](http://tech-angels.github.io/vandamme).
|
8
8
|
|
9
|
+
## 0.3.0 - 2016.03.01
|
10
|
+
|
11
|
+
**How to upgrade**
|
12
|
+
|
13
|
+
When your code defines an `Yt::Audit` object, it should be initialized with a `Yt::Channel` object as `channel:` argument. It used to accept `channel_id` string directly but now your code should define a channel with it first.
|
14
|
+
|
15
|
+
* [ENHANCEMENT] Optionally send in `Yt::Collections::Videos` or `Yt::Collections::Playlists` object as arguments of an `Yt::Audit`, accompanied with `Yt::Models::Channel` object of yt.
|
16
|
+
* [ENHANCEMENT] Send in brand name as an optional argument.
|
17
|
+
* [BUGFIX] Fix videos input with longer description, for Youtube Association.
|
18
|
+
|
9
19
|
## 0.2.2 - 2016.02.24
|
10
20
|
|
11
|
-
|
21
|
+
* [BUGFIX] Fix condition of Info Card
|
12
22
|
|
13
23
|
## 0.2.1 - 2016.02.19
|
14
24
|
|
data/README.md
CHANGED
@@ -24,11 +24,14 @@ The **source code** is available on [GitHub](https://github.com/Fullscreen/yt-au
|
|
24
24
|
|
25
25
|
## Usage
|
26
26
|
|
27
|
-
`run` method returns an array of objects.
|
27
|
+
`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`.
|
28
|
+
|
29
|
+
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.
|
28
30
|
|
29
31
|
```ruby
|
30
|
-
|
31
|
-
|
32
|
+
channel = Yt::Channel.new(id: 'UCPCk_8dtVyR1lLHMBEILW4g')
|
33
|
+
audit = Yt::Audit.new(channel: channel)
|
34
|
+
# => #<Yt::Audit:0x007ffbb43fe780 @channel=#<Yt::Models::Channel...>, @videos=[...], @playlists=[...], @brand="budweiser">
|
32
35
|
audit.run
|
33
36
|
# => [#<Yt::VideoAudit::InfoCard:0x007f94ec8c6f30 @videos=[...]>, #<Yt::VideoAudit::BrandAnchoring...>, #<Yt::VideoAudit::SubscribeAnnotation...>, #<Yt::VideoAudit::YoutubeAssociation...>, #<Yt::VideoAudit::EndCard...>, #<Yt::PlaylistAudit::Description...>]
|
34
37
|
```
|
data/bin/yt-audit
CHANGED
@@ -8,8 +8,9 @@ rescue LoadError
|
|
8
8
|
end
|
9
9
|
|
10
10
|
channel_id = ARGV[0] || 'UCKM-eG7PBcw3flaBvd0q2TQ'
|
11
|
-
audit = Yt::Audit.new(channel_id: channel_id)
|
12
11
|
puts "Channel: https://www.youtube.com/channel/#{channel_id}"
|
12
|
+
channel = Yt::Channel.new(id: channel_id)
|
13
|
+
audit = Yt::Audit.new(channel: channel)
|
13
14
|
audit.run.each do |audit_item|
|
14
15
|
puts
|
15
16
|
puts "#{audit_item.description}"
|
data/lib/yt/audit.rb
CHANGED
@@ -9,33 +9,22 @@ require 'yt/playlist_audit/description'
|
|
9
9
|
|
10
10
|
module Yt
|
11
11
|
class Audit
|
12
|
-
def initialize(
|
13
|
-
@
|
12
|
+
def initialize(channel:, videos: nil, playlists: nil, brand: nil)
|
13
|
+
@channel = channel
|
14
|
+
@videos = videos || channel.videos.includes(:snippet).first(10)
|
15
|
+
@playlists = playlists || channel.playlists.first(10)
|
16
|
+
@brand = brand || channel.title
|
14
17
|
end
|
15
18
|
|
16
19
|
def run
|
17
20
|
[
|
18
|
-
Yt::VideoAudit::InfoCard.new(videos: videos),
|
19
|
-
Yt::VideoAudit::BrandAnchoring.new(videos: videos, brand:
|
20
|
-
Yt::VideoAudit::SubscribeAnnotation.new(videos: videos),
|
21
|
-
Yt::VideoAudit::YoutubeAssociation.new(videos: videos),
|
22
|
-
Yt::VideoAudit::EndCard.new(videos: videos),
|
23
|
-
Yt::PlaylistAudit::Description.new(playlists: playlists)
|
21
|
+
Yt::VideoAudit::InfoCard.new(videos: @videos),
|
22
|
+
Yt::VideoAudit::BrandAnchoring.new(videos: @videos, brand: @brand),
|
23
|
+
Yt::VideoAudit::SubscribeAnnotation.new(videos: @videos),
|
24
|
+
Yt::VideoAudit::YoutubeAssociation.new(videos: @videos),
|
25
|
+
Yt::VideoAudit::EndCard.new(videos: @videos),
|
26
|
+
Yt::PlaylistAudit::Description.new(playlists: @playlists)
|
24
27
|
]
|
25
28
|
end
|
26
|
-
|
27
|
-
private
|
28
|
-
|
29
|
-
def playlists
|
30
|
-
@playlists ||= channel.playlists.first 10
|
31
|
-
end
|
32
|
-
|
33
|
-
def videos
|
34
|
-
@videos ||= channel.videos.first 10
|
35
|
-
end
|
36
|
-
|
37
|
-
def channel
|
38
|
-
@channel ||= Yt::Channel.new id: @channel_id
|
39
|
-
end
|
40
29
|
end
|
41
30
|
end
|
data/lib/yt/audit/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: yt-audit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kang-Kyu Lee
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02
|
11
|
+
date: 2016-03-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yt
|