Permalink
Browse files

Scraper for developer pages.

  • Loading branch information...
1 parent 578ae10 commit ac0161020887cff54f9b27cbcf23eae0cffb54a7 @chadrem committed Jul 19, 2012
Showing with 34 additions and 0 deletions.
  1. +1 −0 lib/market_bot.rb
  2. +33 −0 lib/market_bot/android/developer.rb
View
@@ -7,6 +7,7 @@
require 'market_bot/android/leaderboard/constants'
require 'market_bot/android/leaderboard'
require 'market_bot/android/search_query'
+require 'market_bot/android/developer'
module MarketBot
def self.hydra
@@ -0,0 +1,33 @@
+module MarketBot
+ module Android
+
+ # Developer pages are extremely similar to leaderboard pages.
+ # Amazingly, this inheritence hack works!
+ class Developer < MarketBot::Android::Leaderboard
+ def initialze(developer, 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) * 12
+
+ url = "https://play.google.com/store/apps/developer?"
+ url << "id=#{URI.escape(identifier)}&"
+ url << "start=#{start_val}&"
+ url << "num=12"
+
+ results << url
+ end
+
+ results
+ end
+ end
+
+ end
+end

0 comments on commit ac01610

Please sign in to comment.