Sha256: 083a1bf01d0f72fa7654f08f45e2ecafaaf47c158383db6c78c8803306ac7756

Contents?: true

Size: 630 Bytes

Versions: 10

Compression:

Stored size: 630 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 = []
        response = (NicoQuery::Api::VideoArray.new id_array).get
        @hash = NicoQuery::ObjectMapper::VideoArray.new response[:body]

        @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

10 entries across 10 versions & 1 rubygems

Version Path
nicoquery-0.1.8.9 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.8.8 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.8.7 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.8.6 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.8.5 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.8.4 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.8.3 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.8.2 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.8 lib/nicoquery/crawler/bulk_scraping.rb
nicoquery-0.1.7 lib/nicoquery/crawler/bulk_scraping.rb