Giter Club home page Giter Club logo

amazon-awis's Introduction

amazon-awis

Ruby Amazon Alexa web service REST API using Hpricot with configurable default options and method call options. Uses Response and Element wrapper classes for easy access to REST XML output.

This version is based on github.com/hasham2/amazon-awis but I didn’t like how it was possible to globally alter options. The AWS_ACCESS_KEY_ID and AWS_SECRET_KEY are still global since one will likely only want to initialize these once.

INSTALLATION

$ gem install gaiottino-amazon-awis

EXAMPLE

require 'rubygems'
require 'amazon/awis'

# set the default config; config will be camelized and converted to REST request parameters.
Amazon::Awis.configure do |config|
  config[:aws_access_key_id] = AWS_ACCESS_KEY_ID
  config[:aws_secret_key] = AWS_SECRET_KEY
end

# create an instance of Awis for a specific action and domain
awis = Amazon::Awis.new({ :action => :url_info, :domain => 'google.com' })

# call query with the Response Group you want
resp = awis.query(:rank)

# some common response object methods
res.is_success?   # return true if request was successful

#dynamic methods
res.rank          # return the rank of domain name that was passed
res.dataurl	      # returns the url which was queried

# Query another action/domain after updating the options
awis.options[:domain] = 'yahoo.com/'

Refer to Amazon AWIS documentation for more information on Amazon REST request parameters and XML output: docs.amazonwebservices.com/AlexaWebInfoService/2005-07-11/

SOURCE CODES

LICENSE

(The MIT License)

Copyright © 2010 Daniel Gaiottino (Based on the initial work by Hasham Malik)

amazon-awis's People

Contributors

hasham2 avatar

Stargazers

 avatar

Watchers

 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.