Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #2 from connyhald/master

Added code to get *estimated* sales report
  • Loading branch information...
commit cff3b4a0db0f91266385e3c54d057f0bbf57e592 2 parents 58fcc8e + ac0d8fc
@tmurakam authored
Showing with 34 additions and 0 deletions.
  1. +7 −0 android_checkout_scraper.rb
  2. +27 −0 get-estimated-sales-report.rb
View
7 android_checkout_scraper.rb
@@ -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)
View
27 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
Please sign in to comment.
Something went wrong with that request. Please try again.