compactor 0.2.4 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +9 -6
- data/lib/compactor/scraped_row.rb +28 -1
- data/lib/compactor/scraper.rb +34 -32
- data/lib/compactor/version.rb +1 -1
- data/lib/compactor/xml_parser.rb +22 -0
- data/lib/compactor.rb +1 -0
- data/test/scraped_row_test.rb +78 -0
- data/test/scraper_test.rb +8 -4
- metadata +191 -171
data/Gemfile.lock
CHANGED
@@ -1,15 +1,20 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
compactor (0.
|
4
|
+
compactor (0.3.3)
|
5
|
+
jruby-openssl (= 0.7.3)
|
5
6
|
mechanize (= 2.4)
|
7
|
+
nokogiri (>= 1.5.0, < 1.5.3)
|
6
8
|
|
7
9
|
GEM
|
8
10
|
remote: http://rubygems.org/
|
9
11
|
specs:
|
10
|
-
|
12
|
+
bouncy-castle-java (1.5.0146.1)
|
13
|
+
domain_name (0.5.7)
|
11
14
|
unf (~> 0.0.3)
|
12
15
|
fakeweb (1.3.0)
|
16
|
+
jruby-openssl (0.7.3)
|
17
|
+
bouncy-castle-java
|
13
18
|
mechanize (2.4)
|
14
19
|
domain_name (~> 0.5, >= 0.5.1)
|
15
20
|
mime-types (~> 1.17, >= 1.17.2)
|
@@ -24,14 +29,12 @@ GEM
|
|
24
29
|
metaclass (~> 0.0.1)
|
25
30
|
net-http-digest_auth (1.2.1)
|
26
31
|
net-http-persistent (2.8)
|
27
|
-
nokogiri (1.5.
|
32
|
+
nokogiri (1.5.2-java)
|
28
33
|
ntlm-http (0.1.1)
|
29
34
|
rake (10.0.2)
|
30
35
|
rcov (0.9.11)
|
31
36
|
rcov (0.9.11-java)
|
32
|
-
unf (0.0.5)
|
33
|
-
unf_ext
|
34
|
-
unf_ext (0.0.5)
|
37
|
+
unf (0.0.5-java)
|
35
38
|
vcr (2.0.1)
|
36
39
|
webrobots (0.0.13)
|
37
40
|
|
@@ -2,7 +2,7 @@ module Compactor
|
|
2
2
|
module Amazon
|
3
3
|
class ScrapedRow
|
4
4
|
def initialize(node, mechanize)
|
5
|
-
@node
|
5
|
+
@node = node
|
6
6
|
@mechanize = mechanize
|
7
7
|
end
|
8
8
|
|
@@ -16,6 +16,15 @@ module Compactor
|
|
16
16
|
end
|
17
17
|
end
|
18
18
|
|
19
|
+
def download_report!(validate=false)
|
20
|
+
r_type, r_data = download_report
|
21
|
+
|
22
|
+
# fail if Amazon is saying that total is X but the calculated total is Y
|
23
|
+
validate!(r_type, r_data) if validate
|
24
|
+
|
25
|
+
[r_type, r_data]
|
26
|
+
end
|
27
|
+
|
19
28
|
def download_report
|
20
29
|
buttons = report_buttons
|
21
30
|
button_index = index_of_button(buttons)
|
@@ -73,6 +82,24 @@ module Compactor
|
|
73
82
|
|
74
83
|
private
|
75
84
|
|
85
|
+
def validate!(r_type, r_data)
|
86
|
+
return true unless r_type == :xml # only check xml for now
|
87
|
+
|
88
|
+
parser = Compactor::Amazon::XmlParser.new(r_data)
|
89
|
+
unless parser.valid?
|
90
|
+
error_message = \
|
91
|
+
"Amazon summary amount different from calculated total amount. {" +
|
92
|
+
"type: XML, " +
|
93
|
+
"expected total: $#{"%.2f" % parser.expected_total}, " +
|
94
|
+
"calculated total: $#{"%.2f" % parser.calculated_total}, " +
|
95
|
+
"difference: $#{"%.2f" % (parser.expected_total - parser.calculated_total).abs}" +
|
96
|
+
"}"
|
97
|
+
raise ReportTotalsMismatch.new(error_message)
|
98
|
+
end
|
99
|
+
|
100
|
+
true
|
101
|
+
end
|
102
|
+
|
76
103
|
def last_div
|
77
104
|
last_cell.search("div")[-1]
|
78
105
|
end
|
data/lib/compactor/scraper.rb
CHANGED
@@ -5,13 +5,14 @@ module Compactor
|
|
5
5
|
class AddressParseFailure < StandardError; end
|
6
6
|
class AuthenticationError < StandardError; end
|
7
7
|
class LockedAccountError < StandardError; end
|
8
|
+
class MissingReportButtons < StandardError; end
|
8
9
|
class MissingRow < StandardError; end
|
10
|
+
class MissingXmlReport < StandardError; end
|
9
11
|
class NoMarketplacesError < StandardError; end
|
10
12
|
class NotProAccountError < StandardError; end
|
11
|
-
class UnknownReportType < StandardError; end
|
12
|
-
class MissingXmlReport < StandardError; end
|
13
|
-
class MissingReportButtons < StandardError; end
|
14
13
|
class ReportLoadingTimeout < StandardError; end
|
14
|
+
class ReportTotalsMismatch < StandardError; end
|
15
|
+
class UnknownReportType < StandardError; end
|
15
16
|
|
16
17
|
ATTEMPTS_BEFORE_GIVING_UP = 15 # give up after 20 minutes
|
17
18
|
MARKETPLACE_HOMEPAGE = "https://sellercentral.amazon.com/gp/homepage.html"
|
@@ -82,26 +83,36 @@ module Compactor
|
|
82
83
|
get_reports
|
83
84
|
end
|
84
85
|
|
85
|
-
def
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
86
|
+
def buyer_name
|
87
|
+
tr = @mechanize.page.search!("//tr[@class='list-row']/td[@class='data-display-field'][text()=\"Contact Buyer:\"]").first.parent
|
88
|
+
td = tr.search!("td[2]")
|
89
|
+
td.text.strip
|
90
|
+
rescue => e
|
91
|
+
""
|
92
|
+
end
|
90
93
|
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
94
|
+
def shipping_address
|
95
|
+
td = @mechanize.page.search!("//tr[@class='list-row']/td[@class='data-display-field']/strong[text()='Shipping Address:']").first.parent
|
96
|
+
addr_lines = td.children.map(&:text).reject { |l| l.blank? || l =~ /^Shipping Address/ }
|
97
|
+
parse_address_lines!(addr_lines)
|
98
|
+
rescue => e
|
99
|
+
""
|
100
|
+
end
|
95
101
|
|
96
|
-
|
97
|
-
|
102
|
+
def payee_details(order_id)
|
103
|
+
@mechanize.get order_detail_url(order_id)
|
104
|
+
order = {}
|
105
|
+
order["BuyerName"] = buyer_name
|
106
|
+
order["ShippingAddress"] = shipping_address
|
98
107
|
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
end
|
108
|
+
order
|
109
|
+
rescue => e
|
110
|
+
end
|
103
111
|
|
104
|
-
|
112
|
+
def get_orders(order_ids)
|
113
|
+
orders_hash = {}
|
114
|
+
order_ids.each do |order_id|
|
115
|
+
orders_hash[order_id] = payee_details(order_id)
|
105
116
|
end
|
106
117
|
orders_hash
|
107
118
|
end
|
@@ -224,16 +235,8 @@ module Compactor
|
|
224
235
|
end
|
225
236
|
end
|
226
237
|
|
227
|
-
def timeout_fetching_reports(
|
228
|
-
|
229
|
-
reports_downloaded = reports.map { |type, reports| reports.size }.inject(:+)
|
230
|
-
reports_not_downloaded = reports_to_watch.size
|
231
|
-
total_reports = reports_not_downloaded + reports_downloaded
|
232
|
-
|
233
|
-
true
|
234
|
-
else
|
235
|
-
false
|
236
|
-
end
|
238
|
+
def timeout_fetching_reports(count)
|
239
|
+
count > ATTEMPTS_BEFORE_GIVING_UP
|
237
240
|
end
|
238
241
|
|
239
242
|
# Find the report to download from a row, and add it
|
@@ -241,15 +244,14 @@ module Compactor
|
|
241
244
|
# that the current page stays the current page.
|
242
245
|
def add_to_collection(reports, row)
|
243
246
|
@mechanize.transact do
|
244
|
-
report_type, report = row.download_report
|
247
|
+
report_type, report = row.download_report!(true) # fail if bad total
|
245
248
|
reports[report_type] ||= []
|
246
249
|
reports[report_type] << report
|
247
250
|
end
|
248
251
|
end
|
249
252
|
|
250
253
|
def get_reports_to_watch(reports_to_watch, reports, count=0)
|
251
|
-
return if reports_to_watch.empty? ||
|
252
|
-
timeout_fetching_reports(reports_to_watch, reports, count)
|
254
|
+
return if reports_to_watch.empty? || timeout_fetching_reports(count)
|
253
255
|
|
254
256
|
rescue_empty_results { @mechanize.get @mechanize.page.uri }
|
255
257
|
reports_to_watch.reject! do |row|
|
data/lib/compactor/version.rb
CHANGED
@@ -0,0 +1,22 @@
|
|
1
|
+
module Compactor
|
2
|
+
module Amazon
|
3
|
+
class XmlParser
|
4
|
+
attr_reader :calculated_total, :expected_total
|
5
|
+
def initialize(xml)
|
6
|
+
calculate(Nokogiri::XML::Document.parse(xml))
|
7
|
+
end
|
8
|
+
|
9
|
+
def valid?
|
10
|
+
expected_total == calculated_total
|
11
|
+
end
|
12
|
+
|
13
|
+
private
|
14
|
+
|
15
|
+
def calculate(doc)
|
16
|
+
@expected_total = doc.xpath("//TotalAmount").text.to_f
|
17
|
+
@calculated_total = 0.0
|
18
|
+
doc.xpath("//Amount").each { |t| @calculated_total += t.text.to_f }
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/compactor.rb
CHANGED
data/test/scraped_row_test.rb
CHANGED
@@ -6,4 +6,82 @@ class ScrapedRowTest < Test::Unit::TestCase
|
|
6
6
|
Compactor::Amazon::ScrapedRow.any_instance.stubs(:table_rows).returns([])
|
7
7
|
assert_nil Compactor::Amazon::ScrapedRow.new("node", "mechanize").reload
|
8
8
|
end
|
9
|
+
|
10
|
+
def test_should_fail_if_flagged_to_validate_and_xml_totals_do_not_match
|
11
|
+
Compactor::Amazon::ScrapedRow.any_instance.stubs(:download_report).returns([:xml,"<xml/>"])
|
12
|
+
Compactor::Amazon::XmlParser.any_instance.stubs(:valid?).returns(false)
|
13
|
+
|
14
|
+
row = Compactor::Amazon::ScrapedRow.new("node", "mechanize")
|
15
|
+
assert_raises Compactor::Amazon::ReportTotalsMismatch do
|
16
|
+
row.download_report! true
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def test_should_not_fail_if_flagged_to_validate_and_xml_totals_do_not_match_and_not_xml
|
21
|
+
Compactor::Amazon::ScrapedRow.any_instance.stubs(:download_report).returns([:tsv,"tsv"])
|
22
|
+
Compactor::Amazon::XmlParser.any_instance.stubs(:valid?).returns(false)
|
23
|
+
|
24
|
+
row = Compactor::Amazon::ScrapedRow.new("node", "mechanize")
|
25
|
+
assert_nothing_raised do
|
26
|
+
row.download_report! true
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_should_not_fail_if_flagged_to_validate_and_xml_totals_match
|
31
|
+
Compactor::Amazon::ScrapedRow.any_instance.stubs(:download_report).returns([:xml,"<xml/>"])
|
32
|
+
Compactor::Amazon::XmlParser.any_instance.stubs(:valid?).returns(true)
|
33
|
+
|
34
|
+
row = Compactor::Amazon::ScrapedRow.new("node", "mechanize")
|
35
|
+
assert_nothing_raised do
|
36
|
+
row.download_report! true
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
def test_should_not_fail_if_not_flagged_to_validate_and_xml_totals_do_not_match
|
41
|
+
Compactor::Amazon::ScrapedRow.any_instance.stubs(:download_report).returns([:xml,"<xml/>"])
|
42
|
+
Compactor::Amazon::XmlParser.any_instance.stubs(:valid?).returns(false)
|
43
|
+
|
44
|
+
row = Compactor::Amazon::ScrapedRow.new("node", "mechanize")
|
45
|
+
assert_nothing_raised do
|
46
|
+
row.download_report!
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
def test_should_not_fail_if_not_flagged_to_validate_and_xml_totals_not_match
|
51
|
+
Compactor::Amazon::ScrapedRow.any_instance.stubs(:download_report).returns([:xml,"<xml/>"])
|
52
|
+
Compactor::Amazon::XmlParser.any_instance.stubs(:valid?).returns(true)
|
53
|
+
|
54
|
+
row = Compactor::Amazon::ScrapedRow.new("node", "mechanize")
|
55
|
+
assert_nothing_raised do
|
56
|
+
row.download_report!
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def test_should_know_if_the_expected_total_matches_the_calculated_total
|
61
|
+
report_data = <<-XML
|
62
|
+
<xml>
|
63
|
+
<report>
|
64
|
+
<TotalAmount>10</TotalAmount>
|
65
|
+
<Amount>5</Amount>
|
66
|
+
<Amount>5</Amount>
|
67
|
+
</report>
|
68
|
+
</xml>
|
69
|
+
XML
|
70
|
+
parser = Compactor::Amazon::XmlParser.new(report_data)
|
71
|
+
assert parser.valid?
|
72
|
+
end
|
73
|
+
|
74
|
+
def test_should_know_if_the_expected_total_does_not_match_the_calculated_total
|
75
|
+
report_data = <<-XML
|
76
|
+
<xml>
|
77
|
+
<report>
|
78
|
+
<TotalAmount>10</TotalAmount>
|
79
|
+
<Amount>5</Amount>
|
80
|
+
<Amount>4</Amount>
|
81
|
+
</report>
|
82
|
+
</xml>
|
83
|
+
XML
|
84
|
+
parser = Compactor::Amazon::XmlParser.new(report_data)
|
85
|
+
assert !parser.valid?
|
86
|
+
end
|
9
87
|
end
|
data/test/scraper_test.rb
CHANGED
@@ -2,6 +2,10 @@ require File.dirname(__FILE__) + '/test_helper'
|
|
2
2
|
require File.dirname(__FILE__) + '/../lib/compactor'
|
3
3
|
|
4
4
|
class ScraperTest < Test::Unit::TestCase
|
5
|
+
def setup
|
6
|
+
Compactor::Amazon::XmlParser.any_instance.stubs(:valid?).returns(true)
|
7
|
+
end
|
8
|
+
|
5
9
|
def test_should_not_find_elements_that_do_not_exist
|
6
10
|
VCR.use_cassette("AmazonReportScraper/with_good_login/find_reports/reports_to_request") do
|
7
11
|
scraper = Compactor::Amazon::ReportScraper.new(:email => "far@far.away", :password => "test")
|
@@ -76,11 +80,11 @@ class ScraperTest < Test::Unit::TestCase
|
|
76
80
|
|
77
81
|
assert_equal({
|
78
82
|
"105-1753716-0471420" => {
|
79
|
-
"BuyerName"
|
83
|
+
"BuyerName" => "Lisa M Strand",
|
80
84
|
"ShippingAddress" => {
|
81
|
-
"street"
|
82
|
-
"city"
|
83
|
-
"state"
|
85
|
+
"street" => "W190S6321 Preston Ln",
|
86
|
+
"city" => "Muskego",
|
87
|
+
"state" => "WI",
|
84
88
|
"postalcode" => "53150-8512"
|
85
89
|
}
|
86
90
|
}
|
metadata
CHANGED
@@ -1,116 +1,139 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: compactor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
4
|
+
prerelease: false
|
6
5
|
segments:
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
version: 0.
|
6
|
+
- 0
|
7
|
+
- 3
|
8
|
+
- 3
|
9
|
+
version: 0.3.3
|
11
10
|
platform: ruby
|
12
11
|
authors:
|
13
|
-
- Julio Santos
|
12
|
+
- Julio Santos
|
14
13
|
autorequire:
|
15
14
|
bindir: bin
|
16
15
|
cert_chain: []
|
17
16
|
|
18
|
-
date: 2013-
|
17
|
+
date: 2013-03-06 00:00:00 -08:00
|
18
|
+
default_executable:
|
19
19
|
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: mechanize
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - "="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 4
|
30
|
+
version: "2.4"
|
31
|
+
type: :runtime
|
32
|
+
version_requirements: *id001
|
33
|
+
- !ruby/object:Gem::Dependency
|
34
|
+
name: jruby-openssl
|
35
|
+
prerelease: false
|
36
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
segments:
|
41
|
+
- 0
|
42
|
+
- 7
|
43
|
+
- 3
|
44
|
+
version: 0.7.3
|
45
|
+
type: :runtime
|
46
|
+
version_requirements: *id002
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: nokogiri
|
49
|
+
prerelease: false
|
50
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
segments:
|
55
|
+
- 1
|
56
|
+
- 5
|
57
|
+
- 0
|
58
|
+
version: 1.5.0
|
59
|
+
- - <
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
segments:
|
62
|
+
- 1
|
63
|
+
- 5
|
64
|
+
- 3
|
65
|
+
version: 1.5.3
|
66
|
+
type: :runtime
|
67
|
+
version_requirements: *id003
|
68
|
+
- !ruby/object:Gem::Dependency
|
69
|
+
name: rake
|
70
|
+
prerelease: false
|
71
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
segments:
|
76
|
+
- 0
|
77
|
+
version: "0"
|
78
|
+
type: :development
|
79
|
+
version_requirements: *id004
|
80
|
+
- !ruby/object:Gem::Dependency
|
81
|
+
name: mocha
|
82
|
+
prerelease: false
|
83
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
84
|
+
requirements:
|
85
|
+
- - "="
|
86
|
+
- !ruby/object:Gem::Version
|
87
|
+
segments:
|
88
|
+
- 0
|
89
|
+
- 12
|
90
|
+
- 1
|
91
|
+
version: 0.12.1
|
92
|
+
type: :development
|
93
|
+
version_requirements: *id005
|
94
|
+
- !ruby/object:Gem::Dependency
|
95
|
+
name: vcr
|
96
|
+
prerelease: false
|
97
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
98
|
+
requirements:
|
99
|
+
- - ~>
|
100
|
+
- !ruby/object:Gem::Version
|
101
|
+
segments:
|
102
|
+
- 2
|
103
|
+
- 0
|
104
|
+
- 0
|
105
|
+
version: 2.0.0
|
106
|
+
type: :development
|
107
|
+
version_requirements: *id006
|
108
|
+
- !ruby/object:Gem::Dependency
|
109
|
+
name: fakeweb
|
110
|
+
prerelease: false
|
111
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
112
|
+
requirements:
|
113
|
+
- - ">="
|
114
|
+
- !ruby/object:Gem::Version
|
115
|
+
segments:
|
116
|
+
- 0
|
117
|
+
version: "0"
|
118
|
+
type: :development
|
119
|
+
version_requirements: *id007
|
120
|
+
- !ruby/object:Gem::Dependency
|
121
|
+
name: rcov
|
122
|
+
prerelease: false
|
123
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
124
|
+
requirements:
|
125
|
+
- - "="
|
126
|
+
- !ruby/object:Gem::Version
|
127
|
+
segments:
|
128
|
+
- 0
|
129
|
+
- 9
|
130
|
+
- 11
|
131
|
+
version: 0.9.11
|
132
|
+
type: :development
|
133
|
+
version_requirements: *id008
|
111
134
|
description: Scrape Amazon Seller Central
|
112
135
|
email:
|
113
|
-
- julio@morgane.com
|
136
|
+
- julio@morgane.com
|
114
137
|
executables: []
|
115
138
|
|
116
139
|
extensions: []
|
@@ -118,40 +141,42 @@ extensions: []
|
|
118
141
|
extra_rdoc_files: []
|
119
142
|
|
120
143
|
files:
|
121
|
-
- .gitignore
|
122
|
-
- .travis.yml
|
123
|
-
- Gemfile
|
124
|
-
- Gemfile.lock
|
125
|
-
- LICENSE
|
126
|
-
- README.md
|
127
|
-
- Rakefile
|
128
|
-
- compactor-0.2.3.gem
|
129
|
-
- compactor.gemspec
|
130
|
-
- lib/compactor.rb
|
131
|
-
- lib/compactor/extensions.rb
|
132
|
-
- lib/compactor/scraped_row.rb
|
133
|
-
- lib/compactor/scraper.rb
|
134
|
-
- lib/compactor/version.rb
|
135
|
-
-
|
136
|
-
- test/
|
137
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/
|
138
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/
|
139
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/
|
140
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/
|
141
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/
|
142
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/
|
143
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/
|
144
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/
|
145
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/
|
146
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/
|
147
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/
|
148
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/with_multiple_marketplaces/
|
149
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/
|
150
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/
|
151
|
-
- test/
|
152
|
-
- test/
|
153
|
-
- test/
|
154
|
-
- test/
|
144
|
+
- .gitignore
|
145
|
+
- .travis.yml
|
146
|
+
- Gemfile
|
147
|
+
- Gemfile.lock
|
148
|
+
- LICENSE
|
149
|
+
- README.md
|
150
|
+
- Rakefile
|
151
|
+
- compactor-0.2.3.gem
|
152
|
+
- compactor.gemspec
|
153
|
+
- lib/compactor.rb
|
154
|
+
- lib/compactor/extensions.rb
|
155
|
+
- lib/compactor/scraped_row.rb
|
156
|
+
- lib/compactor/scraper.rb
|
157
|
+
- lib/compactor/version.rb
|
158
|
+
- lib/compactor/xml_parser.rb
|
159
|
+
- test/date_extensions_test.rb
|
160
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_bad_login/raise_error.yml
|
161
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/multiple_pages.yml
|
162
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/no_reports.yml
|
163
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/no_reports_to_request.yml
|
164
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/reports_to_request.yml
|
165
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_balance.yml
|
166
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_orders.yml
|
167
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_orders_big.yml
|
168
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_orders_logging.yml
|
169
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_orders_with_po_box.yml
|
170
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/shipping_address_not_starting_with_number.yml
|
171
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/with_multiple_marketplaces/find_reports/reports_to_request.yml
|
172
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/with_multiple_marketplaces/get_marketplaces.yml
|
173
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/with_single_marketplaces/get_marketplaces.yml
|
174
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_locked_account/raise_error.yml
|
175
|
+
- test/mechanize_extensions_test.rb
|
176
|
+
- test/scraped_row_test.rb
|
177
|
+
- test/scraper_test.rb
|
178
|
+
- test/test_helper.rb
|
179
|
+
has_rdoc: true
|
155
180
|
homepage: ""
|
156
181
|
licenses: []
|
157
182
|
|
@@ -159,51 +184,46 @@ post_install_message:
|
|
159
184
|
rdoc_options: []
|
160
185
|
|
161
186
|
require_paths:
|
162
|
-
- lib
|
187
|
+
- lib
|
163
188
|
required_ruby_version: !ruby/object:Gem::Requirement
|
164
|
-
none: false
|
165
189
|
requirements:
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
version: "0"
|
190
|
+
- - ">="
|
191
|
+
- !ruby/object:Gem::Version
|
192
|
+
segments:
|
193
|
+
- 0
|
194
|
+
version: "0"
|
172
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
173
|
-
none: false
|
174
196
|
requirements:
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
version: "0"
|
197
|
+
- - ">="
|
198
|
+
- !ruby/object:Gem::Version
|
199
|
+
segments:
|
200
|
+
- 0
|
201
|
+
version: "0"
|
181
202
|
requirements: []
|
182
203
|
|
183
204
|
rubyforge_project: compactor
|
184
|
-
rubygems_version: 1.
|
205
|
+
rubygems_version: 1.3.6
|
185
206
|
signing_key:
|
186
207
|
specification_version: 3
|
187
208
|
summary: Scrape Amazon Seller Central
|
188
209
|
test_files:
|
189
|
-
- test/date_extensions_test.rb
|
190
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_bad_login/raise_error.yml
|
191
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/multiple_pages.yml
|
192
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/no_reports.yml
|
193
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/no_reports_to_request.yml
|
194
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/reports_to_request.yml
|
195
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_balance.yml
|
196
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_orders.yml
|
197
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_orders_big.yml
|
198
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_orders_logging.yml
|
199
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_orders_with_po_box.yml
|
200
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/shipping_address_not_starting_with_number.yml
|
201
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/with_multiple_marketplaces/find_reports/reports_to_request.yml
|
202
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/with_multiple_marketplaces/get_marketplaces.yml
|
203
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/with_single_marketplaces/get_marketplaces.yml
|
204
|
-
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_locked_account/raise_error.yml
|
205
|
-
- test/mechanize_extensions_test.rb
|
206
|
-
- test/scraped_row_test.rb
|
207
|
-
- test/scraper_test.rb
|
208
|
-
- test/test_helper.rb
|
209
|
-
has_rdoc:
|
210
|
+
- test/date_extensions_test.rb
|
211
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_bad_login/raise_error.yml
|
212
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/multiple_pages.yml
|
213
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/no_reports.yml
|
214
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/no_reports_to_request.yml
|
215
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/find_reports/reports_to_request.yml
|
216
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_balance.yml
|
217
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_orders.yml
|
218
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_orders_big.yml
|
219
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_orders_logging.yml
|
220
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/get_orders_with_po_box.yml
|
221
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/shipping_address_not_starting_with_number.yml
|
222
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/with_multiple_marketplaces/find_reports/reports_to_request.yml
|
223
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/with_multiple_marketplaces/get_marketplaces.yml
|
224
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_good_login/with_single_marketplaces/get_marketplaces.yml
|
225
|
+
- test/fixtures/vcr_cassettes/AmazonReportScraper/with_locked_account/raise_error.yml
|
226
|
+
- test/mechanize_extensions_test.rb
|
227
|
+
- test/scraped_row_test.rb
|
228
|
+
- test/scraper_test.rb
|
229
|
+
- test/test_helper.rb
|