yt-audit 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +2 -0
- data/lib/yt/audit/version.rb +1 -1
- data/lib/yt/audit.rb +13 -3
- 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: 2836fb86bee42998b942fbdd356c482e756481a1
|
|
4
|
+
data.tar.gz: 932e69b0627fe1fdc4b981cc53b82234bafa7c7b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 47941e89187671d6d2bcfeadf36d437c4566d2f5dc282746a0f021a7e53336bb46e6237b74b9522abfd9d7d5978b66966472ffdb26bf18c2335b87010576580e
|
|
7
|
+
data.tar.gz: e2ca1fbfec7693d4bb7a5c10eeb8869fe664f9a48a0292b3592aaac7cb11394545bf5a5246c026c84f9c409c12ed9a4269468bb3fd655f0ab5fbf24aacb63a97
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,10 @@ 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.1.2 - 2016.02.11
|
|
10
|
+
|
|
11
|
+
* [FEATURE] Add `has_subscribe_annotations?`
|
|
12
|
+
|
|
9
13
|
## 0.1.1 - Unreleased
|
|
10
14
|
|
|
11
15
|
* [ENHANCEMENT] Brand name case-insensitive in `has_brand_anchoring?`
|
data/README.md
CHANGED
data/lib/yt/audit/version.rb
CHANGED
data/lib/yt/audit.rb
CHANGED
|
@@ -5,7 +5,7 @@ module Yt
|
|
|
5
5
|
module Audit
|
|
6
6
|
# Audit any info card of a video
|
|
7
7
|
# @param [String] video_id the video to audit.
|
|
8
|
-
# @return
|
|
8
|
+
# @return [Boolean] if the video has any info card.
|
|
9
9
|
# @raise [NoMethodError] if video_id is not a valid video.
|
|
10
10
|
def self.has_info_cards?(video_id)
|
|
11
11
|
Yt::Annotations.for(video_id).any? do |annotation|
|
|
@@ -16,11 +16,21 @@ module Yt
|
|
|
16
16
|
# Audit brand anchoring of a video
|
|
17
17
|
# @param [String] video_id the video to audit.
|
|
18
18
|
# @param [String] brand name of the video to audit.
|
|
19
|
-
# @return
|
|
19
|
+
# @return [Boolean] if the video title includes brand name.
|
|
20
20
|
# @raise [Yt::Errors::NoItems] if video_id is not a valid video.
|
|
21
21
|
def self.has_brand_anchoring?(video_id, brand)
|
|
22
22
|
video_title = Yt::Video.new(id: video_id).title
|
|
23
|
-
video_title
|
|
23
|
+
!!video_title[/#{brand}/i]
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
# Audit any subscribe annotation of a video
|
|
27
|
+
# @param [String] video_id the video to audit.
|
|
28
|
+
# @return [Boolean] if the video has any link to subscribe in the annotations.
|
|
29
|
+
# @raise [NoMethodError] if video_id is not a valid video.
|
|
30
|
+
def self.has_subscribe_annotations?(video_id)
|
|
31
|
+
Yt::Annotations.for(video_id).any? do |annotation|
|
|
32
|
+
annotation.link && annotation.link[:type] == :subscribe
|
|
33
|
+
end
|
|
24
34
|
end
|
|
25
35
|
end
|
|
26
36
|
end
|
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.1.
|
|
4
|
+
version: 0.1.2
|
|
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-02-11 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: yt
|