module NicoQuery::Crawler::TagSearch
Public Class Methods
each_movie(parsed_movies, &block)
click to toggle source
# File lib/nicoquery/crawler/tag_search.rb, line 34 def each_movie(parsed_movies, &block) while parsed_movies.length > 0 do block.call parsed_movies.shift end end
execute(tag: tag, sort: sort, order: order, &block)
click to toggle source
# File lib/nicoquery/crawler/tag_search.rb, line 9 def execute(tag: tag, sort: sort, order: order, &block) parser = NicoQuery::Parser::TagSearch.new page = 0 loop do command = nil page += 1 result = NicoQuery::Core.tag_search(tag: tag, sort: sort, order: order, page: page) parser.parse result self.each_movie(parser.items) do |movie| command = block.call movie break if command == :break || command != :continue end break if command == :break || command != :continue end end
Private Instance Methods
continue()
click to toggle source
# File lib/nicoquery/crawler/tag_search.rb, line 31 def continue; :continue end
each_movie(parsed_movies, &block)
click to toggle source
# File lib/nicoquery/crawler/tag_search.rb, line 34 def each_movie(parsed_movies, &block) while parsed_movies.length > 0 do block.call parsed_movies.shift end end
execute(tag: tag, sort: sort, order: order, &block)
click to toggle source
# File lib/nicoquery/crawler/tag_search.rb, line 9 def execute(tag: tag, sort: sort, order: order, &block) parser = NicoQuery::Parser::TagSearch.new page = 0 loop do command = nil page += 1 result = NicoQuery::Core.tag_search(tag: tag, sort: sort, order: order, page: page) parser.parse result self.each_movie(parser.items) do |movie| command = block.call movie break if command == :break || command != :continue end break if command == :break || command != :continue end end
stop()
click to toggle source
# File lib/nicoquery/crawler/tag_search.rb, line 32 def stop; :stop end