Coder Social home page Coder Social logo

amazon_product's Introduction

This library is no longer in active development. For a trimmed version, check out Vacuum vacuum.


Amazon Product

Amazon Product is a Nokogiri-backed Ruby wrapper to the [Amazon Product Advertising API] 2.

travis

## Installation

Add to your Gemfile.

gem 'amazon_product'

## Usage

Set up a request.

require "amazon_product"

req = AmazonProduct["us"]

req.configure do |c|
  c.key    = AMAZON_KEY
  c.secret = AMAZON_SECRET
  c.tag    = AMAZON_ASSOCIATE_TAG
end

Search for something.

req << { :operation    => 'ItemSearch',
         :search_index => 'All',
         :keywords     => 'George Orwell' }
res = req.get

Or use a shorthand.

res = req.search('George Orwell')

Customise your request.

res = req.search('Books', :response_group => %w{ItemAttributes Images},
                          :power          => 'George Orwell'

For a reference of available methods and syntax, [read here] 3.

Consume the entire response.

res.to_hash

Quickly drop down to a particular node.

res['Item']

Adapters

Amazon Product defaults to the Net::HTTP library but can be configured to use Curb or EM-HTTP-Request.

amazon_product's People

Contributors

hakanensari avatar joe1chen avatar gerhard avatar laszpio avatar perplexes avatar snoblenet avatar ryanmarshall avatar

Watchers

 avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.