Sha256: ed8ef095923e0e65819b53a521ec400f793379a67d507ab7ea8d297b4d6d6db5
Contents?: true
Size: 699 Bytes
Versions: 2
Compression:
Stored size: 699 Bytes
Contents
require 'yt/video_audit/base' module Yt module VideoAudit # Count how many videos have video description includes # a link to its own channel. class YoutubeAssociation < Base def title 'YouTube Association' end def description 'The number of videos with description has a link to its own channel' end private def valid?(video) video.description.split(' ') .select {|word| Yt::URL.new(word).kind == :channel } .any? {|link| channel_id(link) == video.channel_id } end def channel_id(url) Yt::Channel.new(url: url).id rescue Yt::Errors::NoItems end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
yt-audit-0.3.2 | lib/yt/video_audit/youtube_association.rb |
yt-audit-0.3.1 | lib/yt/video_audit/youtube_association.rb |