Permalink
Browse files

Added --details switch to get more detailed orders.

  • Loading branch information...
Cornelius Hald
Cornelius Hald committed May 3, 2012
1 parent 73392c4 commit d3e932fb900a690138e1b437229bc0cd68fe857a
Showing with 12 additions and 5 deletions.
  1. +4 −2 android_checkout_scraper.rb
  2. +8 −3 get-orders.rb
@@ -86,7 +86,7 @@ def getEstimatedSalesReport(year, month)
# state: financial state, one of followings:
# ALL, CANCELLED, CANCELLED_BY_GOOGLE, CHARGEABLE, CHARGED,
# CHARGING, PAYMENT_DECLINED, REVIEWING
- def getOrderList(startDate, endDate, state = "CHARGED")
+ def getOrderList(startDate, endDate, state = "CHARGED", expanded = false)
try_get("https://checkout.google.com/sell/orders")
@@ -98,7 +98,9 @@ def getOrderList(startDate, endDate, state = "CHARGED")
else
form["financial-state"] = state
end
- #form["column-style"] = "EXPANDED"
+ if (expanded)
+ form["column-style"] = "EXPANDED"
+ end
#form["date-time-zone"] = "Asia/Tokyo"
#form["_type"] = "order-list-request"
#form["query-type"] = ""
View
@@ -6,18 +6,23 @@
require './config.rb'
if (ARGV.size < 2)
- STDERR.puts "Usage: #{$0} <start_date> <end_date> [<state>]"
+ STDERR.puts "Usage: #{$0} <start_date> <end_date> [<state>] [--details]"
exit 1
end
startdate = ARGV[0]
enddate = ARGV[1]
-if (ARGV.size >= 3)
+details = false
+if (ARGV.size >= 3 and ARGV[2] != '--details')
state = ARGV[2]
else
state = "CHARGED"
end
+if (ARGV[ARGV.size - 1] == '--details')
+ details = true
+end
+
scraper = AndroidCheckoutScraper.new
if ($proxy_host != nil)
scraper.proxy_host = $proxy_host
@@ -27,6 +32,6 @@
scraper.email = $email_address
scraper.password = $password
-csv = scraper.getOrderList(startdate, enddate, state)
+csv = scraper.getOrderList(startdate, enddate, state, details)
puts csv
#scraper.dumpCsv(csv)

0 comments on commit d3e932f

Please sign in to comment.