Skip to content

Commit

Permalink
Added code to get the *estimated* sales report as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
Cornelius Hald committed Apr 19, 2012
1 parent 58fcc8e commit ac0d8fc
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
7 changes: 7 additions & 0 deletions android_checkout_scraper.rb
Expand Up @@ -72,6 +72,13 @@ def getSalesReport(year, month)
try_get(url)
return @agent.page.body
end

# Get merchant etimated sales report
def getEstimatedSalesReport(year, month)
url = sprintf('https://play.google.com/apps/publish/salesreport/download?report_date=%04d_%02d&report_type=sales_report&dev_acc=%s', year, month, @dev_acc)
try_get(url)
return @agent.page.body
end

# Get order list
# startDate: start date (yyyy-mm-ddThh:mm:ss)
Expand Down
27 changes: 27 additions & 0 deletions get-estimated-sales-report.rb
@@ -0,0 +1,27 @@
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-

require './android_checkout_scraper'
require './secrets.rb'
require './config.rb'

if (ARGV.size != 2)
STDERR.puts "Usage: #{$0} <year> <month>"
exit 1
end

year = ARGV[0].to_i
month = ARGV[1].to_i

scraper = AndroidCheckoutScraper.new
if ($proxy_host != nil)
scraper.proxy_host = $proxy_host
scraper.proxy_port = $proxy_port
end

scraper.email = $email_address
scraper.password = $password
scraper.dev_acc = $dev_acc

csv = scraper.getEstimatedSalesReport(year, month)
puts csv

0 comments on commit ac0d8fc

Please sign in to comment.