Skip to content

Latest commit

 

History

History
85 lines (64 loc) · 2.07 KB

README.md

File metadata and controls

85 lines (64 loc) · 2.07 KB

Vacuum

[![travis] 1] 2

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

![vacuum] 4

Amazon Product Advertising API

Vacuum knows the [Amazon Product Advertising API] 5 [inside out] 6.

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] 7 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] 8

Workers queuing to crawl AWS.