Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

86 lines (64 sloc) 2.119 kb

Vacuum

travis

Vacuum is a Ruby wrapper to various Amazon Web Services (AWS) APIs.

vacuum

Amazon Product Advertising API

Vacuum knows the Amazon Product Advertising API inside out.

request = Vacuum.new(:product_advertising) do |config|
  config.locale 'US'

  config.key    'key'
  config.secret 'secret'
  config.tag    'tag'
end

# Use an alternative Faraday adapter.
# request.connection do |builder|
#   builder.adapter :typhoeus
# end

# A barebone search request.
request.build operation:    'ItemSearch',
              search_index: 'Books',
              keywords:     'Deleuze'
response = request.get

# A less verbose search.
request.search :books, 'Deleuze'

if response.valid?
  # response.code
  # response.body
  # response.errors
  # response.xml # The Nokogiri XML doc
  # response.to_hash
  response.find('Item') do |item|
    p item['ASIN']
  end
end

Amazon Marketplace Web Services API

The wrapper to the Amazon Marketplace Web Services API is a work-in-progress.

request = Vacuum.new(:mws_products) do |config|
  config.locale      'US'

  config.key         'key'
  config.secret      'secret'
  config.marketplace 'marketplace'
  config.seller      'seller'
end

request.build 'Action'          => 'GetLowestOfferListingsForASIN',
              'ASINList.ASIN.1' => '0231081596'
offers = request.get.find 'GetLowestOfferListingsForASINResult'

Other AWS APIs

Vacuum should work with EC2, S3, IAM, SimpleDB, SQS, SNS, SES, ELB, CW, and so on. Implement and send a pull request.

Addendum

vacuums

Workers queuing to crawl AWS.

Jump to Line
Something went wrong with that request. Please try again.