Services_Amazon (Constructor) [line 121]
Services_Amazon Services_Amazon(
[string
$token = null], [string
$affid = null], [
$locale = 'us'], [
$baseurl = 'http://xml.amazon.com/onca/xml2'])
|
|
Constructor
Parameters:
getApiVersion [line 146]
Retrieves the current version of this classes API.
All major versions are backwards compatible with older version of the same version number. Such as 1.5 would work for a script written to use 1.0. However on the filp side a script that needs 1.5 would not work with API version 1.0.
getAssociateID [line 188]
Retrieves the currently set Associate ID.
Your Associate ID is used to built the links to amazon which will give you credit for the sale. Visit http://associates.amazon.com to sign up for an Associate ID.
getBaseUrl [line 211]
Retrieves the currently set base url.
getLocale [line 234]
Retrieves the locale passed when making a query to Amazon.com.
getModes [line 282]
Retrieves an array of modes supported by Amazon.
The array is arranged with the shorthand version as the key and the human readable version as its value. Below are the current modes in the list.
baby - Baby
books - Books
classical - Classical Music
dvd - DVD
electronics - Electronics
garden - Outdoor Living
kitchen - Kitchen & Housewares
magazines - Magazines
music - Popular Music
pc-hardware - Computers
photo - Camera & Photo
software - Software
toys - Toys & Games
universal - Tools & Hardware
vhs - VHS
videogames - Computer & Video Games
getToken [line 161]
Retrieves the currently set Developer token.
To use Amazon's Web Services you need a developer's token. Visit http://www.amazon.com/webservices and read their license agreement to recieve a free token.
searchActor [line 550]
array searchActor(
string
$actor, [string
$mode = 'dvd'], [interger
$page = 1])
|
|
Searches Amazon for movies that portrays a specific actor.
Example: <?php
require_once 'PEAR.php';
require_once 'Services/Amazon.php';
if(!PEAR::isError($products)) {
} else {
echo $products->message;
}
?>
If you were to fill in the Developer token in the constructor this would search Amazon.com for DVD movies portraying the American Actor Samuel L. Jackson.
Parameters:
searchArtist [line 514]
array searchArtist(
string
$artist, [interger
$page = 1])
|
|
Searches Amazon for music by a specified artist.
Example: <?php
require_once 'PEAR.php';
require_once 'Services/Amazon.php';
if(!PEAR::isError($products)) {
} else {
echo $products->message;
}
?>
If you were to fill in the Developer token in the constructor this would search Amazon.com for music by American Progressive Metal band Dream Theater.
Parameters:
searchAsin [line 333]
array searchAsin(
string
$asin)
|
|
Retrives the information of a product given its unique ASIN code.
Amazon Standard Identification Numbers (ASINs) are unique blocks of 10 letters and/or numbers that identify items. You can find the ASIN on the item's product information page at Amazon.com.
Example: <?php
require_once 'PEAR.php';
require_once 'Services/Amazon.php';
if(!PEAR::isError($products)) {
} else {
echo $products->message;
}
?>
If you were to fill in the Developer token in the constructor this would return the results for George Schlossnagle's book Advanced PHP Programming.
Parameters:
searchAuthor [line 481]
array searchAuthor(
string
$author, [interger
$page = 1])
|
|
Searches Amazon.com for a specific author.
Example: <?php
require_once 'PEAR.php';
require_once 'Services/Amazon.php';
if(!PEAR::isError($products)) {
} else {
echo $products->message;
}
?>
If you were to fill in the Developer token in the constructor this would search Amazon.com for all books written by the great American author Frank Herbert.
Parameters:
searchDirector [line 585]
array searchDirector(
string
$director, [string
$mode = 'dvd'], [interger
$page = 1])
|
|
Searches Amazon for movies by their given director.
Example: <?php
require_once 'PEAR.php';
require_once 'Services/Amazon.php';
if(!PEAR::isError($products)) {
} else {
echo $products->message;
}
?>
If you were to fill in the Developer token in the constructor this would search Amazon.com for DVD movies directed by American film Director George Lucas.
Parameters:
searchIsbn [line 351]
array searchIsbn(
string
$isbn)
|
|
Retrives the information of a book given its unique ISBN number.
International Standard Book Numbers (ISBNs) are unique numbers that identify every book that is published. It is generally located below a barcode on the back of the book. Note: ISBN numbers are synonymous with ASIN numbers as Amazon uses the ISBN for a books ASIN.
Parameters:
searchKeyword [line 407]
array searchKeyword(
string
$keyword, [string
$mode = null], [interger
$page = 1])
|
|
Searches Amazon.com for a specific keyword.
To limit your search to just a specific category such as books then set the $mode param to something other then null. See getModes() for a list of modes.
Example: <?php
require_once 'PEAR.php';
require_once 'Services/Amazon.php';
if(!PEAR::isError($products)) {
} else {
echo $products->message;
}
?>
If you were to fill in the Developer token in the constructor this would search Amazon.com for all books about PHP and return the first 10 results. To retrieve more results you would pass a page number.
Parameters:
searchManufacturer [line 622]
array searchManufacturer(
string
$manufacturer, [string
$mode = 'books'], [interger
$page = 1])
|
|
Search Amazon for products from a specific manufacturer.
This search is synonymous with searching for a book publisher.
Example: <?php
require_once 'PEAR.php';
require_once 'Services/Amazon.php';
if(!PEAR::isError($products)) {
} else {
echo $products->message;
}
?>
If you were to fill in the Developer token in the constructor this would search Amazon.com for DVD movies put out by American film company New Line Cinemas.
Parameters:
searchPublisher [line 658]
array searchPublisher(
$publisher, [interger
$page = 1], string
$manufacturer, string
$mode)
|
|
Search Amazon for products from a specific book publisher.
Example: <?php
require_once 'PEAR.php';
require_once 'Services/Amazon.php';
if(!PEAR::isError($products)) {
} else {
echo $products->message;
}
?>
If you were to fill in the Developer token in the constructor this would search Amazon.com for books published by Coriolis Group Books which publish the "Black Book" series of programming books, some of my favorites.
Parameters:
searchSimilar [line 448]
array searchSimilar(
string
$asin, [string
$mode = null], [interger
$page = 1])
|
|
Searches Amazon for products similer to the Asin passed to it.
To limit your search to just a specific category such as books then set the $mode param to something other then null. See getModes() for a list of modes. If the $mode param is null it will search all modes.
Example: <?php
require_once 'PEAR.php';
require_once 'Services/Amazon.php';
if(!PEAR::isError($products)) {
} else {
echo $products->message;
}
?>
If you were to fill in the Developer token in the constructor this would search Amazon.com for all books related to George Schlossnagle's book Advanced PHP Programming. To retrieve more results you would pass a page number.
Parameters:
searchUpc [line 367]
array searchUpc(
string
$upc)
|
|
Retrives the information of a product given its unique UPC number.
Since Amazon usually carries the latest version of a product it may not be possible to find a product given its UPC even though a later version appears on Amazon.com.
Parameters:
searchWishlist [line 695]
array searchWishlist(
string
$wishlist)
|
|
Retrieves a persons wishlist items given their unique ID.
To find a specific wish list ID number, simply travel to the page that contains the list that you are interested in, and look for the list's 13 character ID in web page's URL. (It appears after the "/obidos/registry/" string). As an example, the following URL contains the list ID 1QKCTUTWKI1AZ: http://www.amazon.com/exec/obidos/registry/1QKCTUTWKI1AZ.
Example: <?php
require_once 'PEAR.php';
require_once 'Services/Amazon.php';
if(!PEAR::isError($products)) {
} else {
echo $products->message;
}
?>
If you were to fill in the Developer token in the constructor this would search Amazon.com for my wishlist and return all the products currently on it.
Parameters:
setAssociateID [line 200]
void setAssociateID(
string
$affid)
|
|
Sets the Associate ID to use when building links to Amazon.com.
Parameters:
setBaseUrl [line 223]
void setBaseUrl(
string
$baseurl)
|
|
Sets the base url used when making a query to Amazon.com.
Parameters:
setLocale [line 248]
void setLocale(
string
$locale)
|
|
Sets the locale passed when making a query to Amazon.com.
Currently only us, uk, and de are supported by Amazon.
Parameters:
setToken [line 173]
void setToken(
string
$token)
|
|
Sets the Developer token to use when quering Amazon's Web Services.
Parameters: