Sha256: 5ec4d00dbb96cfb0f75bc4db01fa427259394ecc10c647a0abe22b17a698cbe4

Contents?: true

Size: 667 Bytes

Versions: 2

Compression:

Stored size: 667 Bytes

Contents

module MarketBot
  module Movie
    class SearchQuery < MarketBot::Movie::Leaderboard
      def initialize(query, options={})
        super(query, nil, options)
      end

      def market_urls(options={})
        results = []

        min_page = options[:min_page] || 1
        max_page = options[:max_page] || 25

        (min_page..max_page).each do |page|
          start_val = (page - 1) * 24

          url = "https://play.google.com/store/search?"
          url << "q=#{URI.escape(identifier)}&"
          url << "c=movies&start=#{start_val}&"
          url << "num=24&hl=en"

          results << url
        end

        results
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
market_bot-0.14.0 lib/market_bot/movie/search_query.rb
market_bot-0.13.0 lib/market_bot/movie/search_query.rb