module Amazon::Search

Load this module with:

require 'amazon/search'

This module provides basic Amazon search operations.

Constants

ALL_EDITIONS

The following constants govern whether all editions of books are returned when performing Amazon::Search::Request#author_search, Amazon::Search::Request#keyword_search and Amazon::Search::Request#power_search.

ALL_PAGES

Use the special constant ALL_PAGES when you are performing a search that accepts a page number as a parameter, but you want to retrieve all pages, not just a single page.

HEAVY

Perform a HEAVY search when you want AWS to return all data that it has on a given search result.

LIGHT
LITE

Perform a LITE search when you just want a small subset of the data that AWS has for a given search result. See the AWS documentation for more details.

MAX_HEAVY_ASINS

Maximum number of ASINs that can be handled by a heavy search.

MAX_HEAVY_UPCS

Maximum number of UPCs that can be handled by a heavy search.

MAX_LITE_ASINS

Maximum number of ASINs that can be handled by a lite search.

MAX_LITE_UPCS

Maximum number of UPCs that can be handled by a lite search.

MAX_REDIRECTS

Maximum number of 301 and 302 HTTP responses to follow, should Amazon later decide to change the location of the service.

RATE_LIMIT_REQUESTS

RATE_LIMIT_REQUESTS must be true for compliance with Amazon Web Services regulations, which stipulate no more than one search per second.

SINGLE_EDITION

Public Class Methods

modes() click to toggle source

Returns an Array of valid product search modes, such as:

apparel, baby, books, classical, dvd, electronics, garden, kitchen, magazines, music, pc-hardware photo, software, tools, toys, universal, vhs, video, videogames, wireless-phones

# File lib/amazon/search.rb, line 249
def Search.modes
  %w[apparel baby books classical dvd electronics garden kitchen
     magazines music pc-hardware photo software tools toys universal vhs
     video videogames wireless-phones]
end
offer_types() click to toggle source

Returns an Array of valid offer types, such as:

All, ThirdPartyNew, Used, Collectible, Refurbished

# File lib/amazon/search.rb, line 260
def Search.offer_types
  %w[All ThirdPartyNew Used Collectible Refurbished]
end
sort_types(mode) click to toggle source

Returns an Array of valid sort types for mode, or nil if mode is invalid.

# File lib/amazon/search.rb, line 268
def Search.sort_types(mode)
  SORT_TYPES.has_key?(mode) ? SORT_TYPES[mode] : nil
end