Compactor
Scrape Amazon Seller Central
Installation
Add this line to your application's Gemfile:
gem 'compactor'
And then execute:
$ bundle
Or install it yourself as:
$ gem install compactor
Usage
rake test:coverage
def scrape(email, password, from, to)
scraper = Compactor::Amazon::ReportScraper.new(:email => email, :password => password)
marketplaces = scraper.marketplaces
original_from = from
original_to = to
marketplaces.each do |marketplace|
scraper.select_marketplace marketplace[1]
from = original_from
to = original_to
puts "Marketplace: #{marketplace[1]}"
while from < to
begin
reports_by_type = scraper.reports(from, to)
puts "There are #{reports_by_type.size} reports between #{from.to_date} and #{to.to_date}"
rescue Exception => e
puts "ERROR: #{e.} - USER: #{email}"
end
from += 1.week
end
end
end
scrape "[email protected]", "secret", DateTime.parse("1/1/2012"), DateTime.now
Contributing
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Added some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request
Contributors
- Trae Robrock ( https://github.com/trobrock )
- Julio Santos ( https://github.com/julio )
To-do
- Refactor
- 100% coverage