Sha256: 0aca29007c626b8fff7d5613cf56eaf278c73a288a88972e11cf55b528001c1c
Contents?: true
Size: 1022 Bytes
Versions: 22
Compression:
Stored size: 1022 Bytes
Contents
require "nicoquery/api/tag_search_rss" require "nicoquery/object/tag_search" require "nicoquery/object_mapper/tag_search_rss" require "nori" module NicoQuery module Crawler module TagSearch def execute(tag: tag, sort: sort, order: order, &block) page = 0 loop do command = nil page += 1 tag_search_object = NicoQuery::Object::TagSearch.new tag: tag, sort: sort, order: order, page: page self.each_movie(tag_search_object.movies) do |movie| command = block.call movie break if command == :break || command != :continue end break if command == :break || command != :continue end end private def continue; :continue end def stop; :stop end def each_movie(parsed_movies, &block) while parsed_movies.length > 0 do block.call parsed_movies.shift end end module_function :execute module_function :each_movie end end end
Version data entries
22 entries across 22 versions & 1 rubygems