Sha256: e4f56ccf62e2fdb5de3c91b878b22b7f364eb9d3521decf664def27b3c6aa95a

Contents?: true

Size: 619 Bytes

Versions: 8

Compression:

Stored size: 619 Bytes

Contents

require "nicoquery/api/video_array"
require "nicoquery/object_mapper/video_array"
require "nicoquery/object/movie"
require "nori"
require "pry"


module NicoQuery
  module Crawler
    module BulkScraping
      def execute(id_array, &block)
        @movies = []
        source = (NicoQuery::Api::VideoArray.new id_array).get
        @hash = NicoQuery::ObjectMapper::VideoArray.new source

        @hash.movies.each do |movie|
          m = NicoQuery::Object::Movie.new movie.video_id
          m.set_video_array_source movie
          block.call m
        end
      end

      module_function :execute
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
nicoquery-0.1.6.1 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.6 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.5 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.4 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.3 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.2 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.1 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.0 lib/nicoquery/crawler/bulk_scraping.rb