Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

dustbag

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dustbag

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Dustbag

Build Status Code Climate Test Coverage

Dustbag is a set of response parsers for Vacumm (a Ruby wrapper of the Amazon Product Advertising API

Vacuum is an excellent client for the Amazon Product Advertising API, it handles all the possible interactons with the API, but unfortunately you're required to implement your own response parse mechanisms. So Vacuum just give us a ton of dust (in form of xml), which is not bad, because that's not its job, dustbag's job is to handle all that dust and give it a meaningful use.

Installation

Add this line to your application’s Gemfile:

gem 'dustbag'

Prerequisite

You'll need credentials to access to the Amazon Product Advertising API, also an affiliate tag, you can get them following this instructions

Once you get your credentials, you'll need to configure Vacuum to use your credentials, you have two options, you can set the following env vars:

export AWS_ACCESS_KEY_ID=key
export AWS_SECRET_ACCESS_KEY=secret

Or, you can explicitly say to vacuum to use your credentials:

request.configure(
    aws_access_key_id: 'key',
    aws_secret_access_key: 'secret',
    associate_tag: 'tag'
)

One more thing, this gem makes use of the Money gem, money makes use of i18n to format money strings, by default this behaviour is disabled, if you want to enable i18n with money, you can enable it by setting the next env var:

export USE_I18N_FOR_MONEY=true

Usage

require 'vacuum'
require 'dustbag'

request = Vacuum.new
request.associate_tag = 'tag'

response = request.item_search(
  query: {
    'Keywords' => 'Architecture',
    'SearchIndex' => 'Books'
  }
)

response.parser = Dustbag::Parser

response.parse

You'll get an ItemSearchReponse object, this object has an 'items' method which is a collection of the Items matchig your search, if you want to see what can you do with these itmes, look at the source code of the Item class

Project status

Right now, there is only one response parser implemented (ItemSearchResponse), the remaining work is to implement the following responses:

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

FAQs

Package last updated on 08 Nov 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc