Sha256: 9c06939a8143090a44db234e3aa621b2c6dc8f153f6377e6db90c6f377c9689c

Contents?: true

Size: 567 Bytes

Versions: 5

Compression:

Stored size: 567 Bytes

Contents

require 'yt/video_audit/base'

module Yt
  module VideoAudit
    # Count how many subject videos use at least 80% of 500 character limit
    # of tags.
    class TagsLength < Base
      def title
        'Length of Tags'
      end

      def description
        'The number of videos that use at least 80%'\
        ' of the available tags length limit'
      end

    private

      def valid?(video)
        tags_length = video.tags.map {|tag| tag.include?(' ') ? "\"#{tag}\"" : tag }.join(",").length
        tags_length / 500.0 >= 0.8
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
yt-audit-0.6.0 lib/yt/video_audit/tags_length.rb
yt-audit-0.5.5 lib/yt/video_audit/tags_length.rb
yt-audit-0.5.4 lib/yt/video_audit/tags_length.rb
yt-audit-0.5.3 lib/yt/video_audit/tags_length.rb
yt-audit-0.5.2 lib/yt/video_audit/tags_length.rb