# File lib/nicovideo/ranking.rb, line 3 def initialize agent, type='mylist', span='daily', category='all', pagenum=nil super(agent) @type = type @category = category @pagenum = pagenum @url = url() self.register_getter ["videos"] end
# File lib/nicovideo/ranking.rb, line 25 def parse(page) ranking = page/'h3/a[@class=video]' @videos = ranking.inject([]) {|arr,v| # #puts v.attributes['href'] vp = VideoPage.new(@agent, v.attributes['href'].sub(/#{BASE_URL}\/watch\/(\w+)$/,'\1')) vp.title = v.inner_html arr << vp } end
Generated with the Darkfish Rdoc Generator 2.