yt-audit 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- 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 -0
- 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: 20370ef1252c22d1d5d21298ca8b121863a774c9
|
4
|
+
data.tar.gz: 1d13aff30935f1be315d869c9507990f1643688e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2b55c53a96d283c0c14d8c8308e01f5671819e00a84c6569a52070258eb3ca01609d1b526094e3cd60e7e7cc0d5053fc169ecab9beb6ba76ad58409b66bf8f6
|
7
|
+
data.tar.gz: 54fed6b319432abeed3bf11eadc64219f8832b13dce7218b3d5ed8f817a6c6294c41151393e59026d69819a60e2f6265053e05ebbc74fb45697fb51d48ce755b
|
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.4 - 2016.02.17
|
10
|
+
|
11
|
+
* [FEATURE] Add `has_end_cards?`
|
12
|
+
|
9
13
|
## 0.1.3 - 2016.02.16
|
10
14
|
|
11
15
|
* [FEATURE] Add `has_link_to_own_channel?`
|
data/README.md
CHANGED
data/lib/yt/audit/version.rb
CHANGED
data/lib/yt/audit.rb
CHANGED
@@ -39,5 +39,18 @@ module Yt
|
|
39
39
|
.select {|word| Yt::URL.new(word).kind == :channel }
|
40
40
|
.any? {|link| Yt::Channel.new(url: link).id == video.channel_id }
|
41
41
|
end
|
42
|
+
|
43
|
+
# Audit end cards of a video
|
44
|
+
# @param [String] video_id of the video to audit.
|
45
|
+
# @return [Boolean] if the video has any annotation, other than info cards,
|
46
|
+
# with a link in it, at the end of video, stays for more than 5 seconds.
|
47
|
+
def self.has_end_cards?(video_id)
|
48
|
+
video_duration = Yt::Video.new(id: video_id).duration
|
49
|
+
Yt::Annotations.for(video_id).any? do |annotation|
|
50
|
+
!annotation.is_a?(Yt::Annotations::Card) && annotation.link &&
|
51
|
+
annotation.ends_at.ceil == video_duration &&
|
52
|
+
video_duration - annotation.starts_at > 5
|
53
|
+
end
|
54
|
+
end
|
42
55
|
end
|
43
56
|
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.4
|
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-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: yt
|