Skip to content

Instantly share code, notes, and snippets.

@tetu1225
Created June 27, 2011 09:25
Show Gist options
  • Save tetu1225/1048563 to your computer and use it in GitHub Desktop.
Save tetu1225/1048563 to your computer and use it in GitHub Desktop.
Amazon AWS Code
require 'rubygems'
require 'sinatra'
require 'amazon/aws/search'
require 'haml'
require 'sass'
include Amazon::AWS
include Amazon::AWS::Search
get '/' do
@var = "Hello Haml!"
haml :index
end
get '/item_search/:keywords' do
is = ItemSearch.new('Books', {'Keywords' => params[:keywords]})
is.response_group = ResponseGroup.new('Medium')
req = Request.new
req.locale = 'jp'
response = req.search(is)
@items = response.item_search_response[0].items[0].item
haml :item_search
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment