class NicoAPI::Parser::TagSearch::Item
Public Class Methods
new(object)
click to toggle source
# File lib/nicoapi/parser/tag_search.rb, line 38 def initialize(object) @object = object end
Public Instance Methods
description()
click to toggle source
# File lib/nicoapi/parser/tag_search.rb, line 64 def description @_description ||= Description.new @object["description"] end
length()
click to toggle source
# File lib/nicoapi/parser/tag_search.rb, line 68 def length description.raw_text.scan(/(?<=class\=\"nico\-info\-length\"\>)\d{1,}\:\d{1,2}(?=\<\/strong\>)/) length_string = $&.to_s.split(':') length_string[0].to_i * 60 + length_string[1].to_i end
publish_date()
click to toggle source
# File lib/nicoapi/parser/tag_search.rb, line 55 def publish_date Time.parse @object["pubDate"] end
thumbnail_url()
click to toggle source
# File lib/nicoapi/parser/tag_search.rb, line 59 def thumbnail_url description.raw_text.scan(/(?<=src\=\").{1,}(?=\"\swidth)/) $& end
title()
click to toggle source
# File lib/nicoapi/parser/tag_search.rb, line 42 def title @object["title"] end
url()
click to toggle source
# File lib/nicoapi/parser/tag_search.rb, line 51 def url @object["link"] end
video_id()
click to toggle source
# File lib/nicoapi/parser/tag_search.rb, line 46 def video_id url.scan(/(sm|nm)\d{1,}\Z/) $& end