BUY THIS BOOK
Add to Cart

Print Book $24.95


Safari Books Online

What is this?

Add to UK Cart

Print Book £17.50

What is this?

Looking to Reprint this content?


Amazon Hacks
Amazon Hacks 100 Industrial-Strength Tips & Tools By Paul Bausch
August 2003
Pages: 302

Cover | Table of Contents | Colophon


Table of Contents

Chapter 1: Browsing and Searching
Using Amazon.com is easy. Even novice web users with a bit of time and curiosity can find exactly what they're looking for and complete a transaction fairly effortlessly. Beneath this user-friendly exterior, though, is a powerful application that helps people discover information, voice opinions, participate in a community, and sell things.
First and foremost, Amazon.com is a web application—not to be confused with simple, flat, static pages. In reality, each "page" at Amazon is generated right when you request it, personalized for your viewing pleasure and particular interests. Amazon can track which products you've viewed and display a list of similar or related products. Or it can include an item from your Wish List on another item's product detail page. When browsing the site, most of the factors that make the experience unique are hidden from view. But the nature of the Web—which for the most part consists of simple, text-based pages addressed by URL—exposes some of these factors, and allows you to play with the settings embedded in URLs and pages to exert some minor control over the application and the pages it cooks up and serves you.
The core activities at Amazon.com are browsing, searching, and purchasing products. If you've spent any time at Amazon.com, then you know it has millions of products in dozens of categories beyond the books for which it is primarily known. Thinking of the site in terms of individual pages is overwhelming; thinking in terms of page templates is much more manageable. A template is like a document shell that can be used over and over again to display information. The shell is filled with whatever information is requested at the time. In these terms, Amazon has only a handful of templates, including search results, category home pages, and product detail pages. Looking at the structure instead of the information makes it much easier to understand how Amazon operates.
Every Amazon page offers information for your perusal, and
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Hacks #1-12
Using Amazon.com is easy. Even novice web users with a bit of time and curiosity can find exactly what they're looking for and complete a transaction fairly effortlessly. Beneath this user-friendly exterior, though, is a powerful application that helps people discover information, voice opinions, participate in a community, and sell things.
First and foremost, Amazon.com is a web application—not to be confused with simple, flat, static pages. In reality, each "page" at Amazon is generated right when you request it, personalized for your viewing pleasure and particular interests. Amazon can track which products you've viewed and display a list of similar or related products. Or it can include an item from your Wish List on another item's product detail page. When browsing the site, most of the factors that make the experience unique are hidden from view. But the nature of the Web—which for the most part consists of simple, text-based pages addressed by URL—exposes some of these factors, and allows you to play with the settings embedded in URLs and pages to exert some minor control over the application and the pages it cooks up and serves you.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Amazon Product Pages
The core activities at Amazon.com are browsing, searching, and purchasing products. If you've spent any time at Amazon.com, then you know it has millions of products in dozens of categories beyond the books for which it is primarily known. Thinking of the site in terms of individual pages is overwhelming; thinking in terms of page templates is much more manageable. A template is like a document shell that can be used over and over again to display information. The shell is filled with whatever information is requested at the time. In these terms, Amazon has only a handful of templates, including search results, category home pages, and product detail pages. Looking at the structure instead of the information makes it much easier to understand how Amazon operates.
Every Amazon page offers information for your perusal, and actions you can perform. Information includes book titles, prices, customer reviews—anything that adds to your knowledge of products and helps you make a buying decision. Actions include adding a product to your cart or Wish List, posting a review, rating an item, making a purchase—anything that explicitly provides Amazon.com with input or a directive.
You can think of a product detail page as the home page of a particular item at Amazon. It's the workhorse of Amazon.com, and studying what's available there provides insight into almost all of the site's features. Figure 1-1 shows a typical product detail page, this one for Google Hacks, a sibling of the book you're reading.
Figure 1-1: Amazon detail page
What you'll see first on any product detail page is an image of the product (if available) and quick product details:
Product Name or Title
The most important product detail, of course, is what the item is called. A book might have extra information, like its subtitle or series, in its title. An electronic gadget might include a manufacturer's model number.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Find a Product's ASIN
Many hacks and features depend on knowing a product's Amazon ASIN; here are a few ways to track it down.
ASIN stands for Amazon Standard Item Number, and every product Amazon sells has one. It's a number that's unique to Amazon, and it is at the center of the Amazon universe. Many pages and features rely on the ASIN, so the first skill needed in tweaking Amazon is the ability to hunt down and gather ASINs.
Finding the ASIN for a book is easy because it's the same as the ISBN. ISBN stands for International Standard Book Number, and is a unique numerical ID given to every book published since 1972. The key word is standard, because the ISBN allows the book to be identified across varied systems. Libraries, publishers, bookstores, and anyone who handles books use ISBNs to identify them. Not only does each book have a unique ISBN, but each edition of the book has its own ISBN. That way there's never confusion between the hardback and paperback versions of a book.
So where is this magical ISBN number? Turn this book around, look at the back cover, and find the UPC barcode on the back. Usually printed just above the UPC is "ISBN" followed by 10 digits, as in Figure 1-2.
Figure 1-2: UPC symbol with ISBN highlighted
You can also usually find the ISBN printed somewhere on the copyright page at the front of the book. Sometimes the digits are separated by dashes, but only the numbers are important. This book's ISBN is 0-596-00542-3.
Finding ASINs for other products, such as DVDs, CDs, or even toys, isn't quite as straightforward. Amazon doesn't use any standard method of identification for other products, so each ASIN is unique to Amazon. A quick way to find the ASIN is to search for the item on Amazon and go to its product detail page. The ASIN will be printed on the page, as shown in Figure 1-3.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Find a CD's ASIN with the UPC
Instead of searching by Title or Artist, you can find an ASIN for a CD by using the UPC.
Almost every product has a UPC (Universal Price Code). Amazon doesn't offer product searches by UPC through their main web site, but they do offer it for music products through their Web Services.
Following is a simple bit of JavaScript code that brings up a CD's product detail page based on a UPC.
To run this script you'll just need a developer's token Section 6.4 and Internet Explorer for Windows.
Save this piece of HTML as a text file on your computer. Name it something appropriate (cd_asin.html will do nicely).
<html>

<head>

<title>Find a CD's ASIN</title>

<script language="JavaScript">

function getDetailPage(upc) {

    var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");

    xmlhttp.Open("GET", "http://xml.amazon.com/onca/xml2?t=webservices-[RETURN]
20&dev-t=insert developer'stoken&UpcSearch="+upc+"&mode=music&type=lite[RETURN]
&f=xml", false);
    xmlhttp.Send(  );
    var response = xmlhttp.responseXML;
    if (response.selectSingleNode("/ProductInfo/ErrorMsg")) {
        alert(response.selectSingleNode("/ProductInfo/ErrorMsg").text);
    } else {
        var asin = response.selectSingleNode("/ProductInfo/Details/Asin")[RETURN]
.text;
        document.location = "http://amazon.com/o/ASIN/" + asin;
    }
}

</script>

</head>

<body>

<form>
    <input name="upc" type="text" size="25">
    <input type="button" value="Go" 
    onClick="getDetailPage(document.forms[0].upc.value);">
</form>

</body>

</html>
Point your browser at the HTML page, cd_asin.html, enter a UPC code into the form, and click the Go button. If a match is found, you'll be taken to that CD's product detail page where you can jot down the ASIN.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Jump to a Product Using Its ASIN
Once you have a product's ASIN, you can jump straight to its product detail page.
Having a product's ASIN means you're never more than one click away from its product detail page. The easiest path to the page is to put the ASIN in any Amazon search box, as seen in Figure 1-5.
Figure 1-5: Searching by ASIN
Rather than displaying a list of search results for you to choose from, you'll be taken directly to the product's detail page.
You can also skip the searching altogether and just type in the URL. Once you're familiar with the URL pattern, you can plug in any ASIN and get the page you're looking for. Either of these URLs will take you to the product detail page for the corresponding ASIN:
http://www.amazon.com/exec/obidos/ASIN/insert ASIN here
http://www.amazon.com/exec/obidos/tg/detail/-/insert ASIN here/
It is Amazon's prerogative to change their URL syntax at any point. Amazon.com is a constantly evolving application, and its interfaces change from time to time. You can always find the latest information about linking to Amazon through their Associates site (http://www.amazon.com/associates/).
If these URLs aren't bringing up a product detail page, you may have an item that isn't in Amazon's catalog. Chances are good that a book is in the catalog of at least one of Amazon's properties; it just may not be available at Amazon.com. Try changing the base URL to amazon.co.uk for books from the UK, or amazon.ca for books from Canada. Amazon's international sites all follow the same URL conventions:
http://www.amazon.co.uk/exec/obidos/ASIN/insert ASIN here/
http://www.amazon.ca/exec/obidos/tg/detail/-/insert ASIN here/
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Create Shorter URLs
Shortening a long Amazon URL is just a matter of knowing where to put the ASIN.
If you've ever tried to send a link to an Amazon product detail page to your friends via email, you know what a hassle those long Amazon URLs can be. Most email programs wrap the text at 72 characters and end up breaking the URL, often making it unusable. Next time, instead of copying and pasting the URL exactly as you see it, try cropping it a bit so the lines won't wrap. Here's what a URL copied directly from Amazon looks like:
http://www.amazon.com/exec/obidos/ASIN/0596004478/qid%3D1049157816/[RETURN]
sr%3D11-1/ref%3Dsr%5F11%5F1/104-2773718-4336742
For those of you keeping score at home, that's 114 characters! The core piece we're looking to dig out and preserve, the ASIN [Hack #1], is the only bit really needed to target the right product page. Everything after the 10-digit ASIN is garbage—session tracking and other bits and bobs used by Amazon—when we just want to link to the page. So we can instantly make a shorter link by removing the excess baggage:
http://www.amazon.com/exec/obidos/ASIN/0596004478/
That's much better. We're down to 50 characters, well within the non-wrap zone of most email clients. But if you really want to push the character-limit envelope, there's a little-known way (contributed by Cyrus Durgin at Amazon) to shorten the URL even further. You can replace exec/obidos simply with o, as in:
http://amazon.com/o/ASIN/0596004478
That brings us down to 35 characters. (OK, so maybe taking out the www. was cheating, but 39 is still impressive.) Now the URL is suitable for email, instant messages, or even writing out long-hand!
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Link Directly to Product Images
Just as product detail URLs follow a certain pattern, image URLs are just as predictable.
Just as every page has a URL, so too does every product image. Finding the URL is fairly easy in most browsers. In Internet Explorer on Windows, right-click the image and choose Properties. Once you have the image URL, you can bring it up in the browser by placing it in the address bar. Some browsers—Safari for Mac OS X, for instance—make this a single step via the Open Image in New Window context-menu item.
Amazon image URLs are just as dynamic as Amazon pages. By understanding the image URL pattern, you can find images for products based on their ASIN and customize from there.
For instance, the following standard image URL brings up a standard product image, the Google Hacks book cover in Figure 1-6:
http://images.amazon.com/images/P/0596004478.01._PE30_PI_SCMZZZZZZZ_.jpg
Figure 1-6: Google Hacks product image
If you're getting good at spotting ASINs [Hack #1], you'll see this product's ASIN in the URL. By changing it, you can find the image for other products (see Figure 1-7):
http://images.amazon.com/images/P/0596004613.01._PE30_PI_SCMZZZZZZZ_.jpg
Figure 1-7: Linux Server Hacks product image
Keep in mind that you can link to an image of any product that Amazon sells, as long as you have the ASIN. The following URL shows an iPod MP3 player from Amazon's Electronics catalog (see Figure 1-8):
http://images.amazon.com/images/P/B00006FDRB.01._PE30_PI_SCMZZZZZZZ_.jpg
Figure 1-8: iPod product image
These images have something else in common: a 30% off graphic in the lower-right corner. With closer examination of the URLs, you can see what might be affecting the graphic. The section
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Switch to a Text-Only Amazon
Make the Amazon.com web site leaner and meaner by taking away the images.
Now that you know some of the secrets behind Amazon image URLs, you can make those images go away! Why in the world would anyone want to do that? Well, if you're one of those unfortunate souls who still use a modem to connect to the Web, eliminating images can mean a big boost in speed. It's also handy if you're scraping Amazon with a script. Fewer images means less HTML and fewer bytes transferred.
There are two methods for going all-text. The first involves a little URL customization. Adding a /t/ after any product ID [Hack #1], Wish List ID [Hack #18], or List ID [Hack #41] gives you the text-only version of the page:
http://amazon.com/o/ASIN/0596004478/t/
         
From there, any links you follow will be in text-only mode. If you'd rather start from the home page, you can use this URL, also with the trailing /t/:
http://www.amazon.com/exec/obidos/subst/home/home.html/t/
         
Or, to go extremely minimalist, you could use the version intended for Pocket PCs in a standard browser, as shown in Figure 1-12:
http://www.amazon.com/pocketpc/
Figure 1-12: Amazon PocketPC version in a standard web browser
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Take Amazon Anywhere
Amazon.com is just as on-the-move as you are, and you can access Amazon on your cell phone or PDA if you know where to look.
"Amazon Anywhere" refers to Amazon's system of providing service to alternate devices. Amazon wants their service to be available to any device that connects to the Internet. Beyond the standard web interface written with HTML, they offer their site in a variety of other formats for different devices like cell phones and PDAs. You can find a detailed description at http://www.amazon.com/anywhere.
The URL to visit Amazon.com via a mobile device is often already available via your cell/service provider's site. If you'd like to visit these directly, though, you can key in one of these URLs:
  • Cell phones: http://amazon.com/phone
  • PDAs: http://amazon.com/pocketpc or http://amazon.com/mypalm
If you don't have a WAP phone and you'd just like to get a sense of how the alternate site works, try a web-based WAP emulator. Yospace (http://www.yospace.com/spedemo.html) has a good emulator that can impersonate quite a few specific phones. Figure 1-13 shows how Amazon Anywhere appears on the Sony T68i emulator (and the T68i phone itself).
Figure 1-13: Yospace SmartPhone WAP emulator
Though it's a very simple interface, most of Amazon's features are present even in this lo-fi version. You can browse, search for, and buy products; you can also find product information, average customer review ratings, and purchase circles [Hack #44]. You also have access to all of Amazon's product lines including cell phones—which means you can buy your next cell from your current cell phone.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Browse and Search Categories with Browse Nodes
Use browse node IDs to find books based on categories.
Just as Amazon has alphanumeric IDs for every item they sell, they also have ID numbers representing each subject area to which items belong. Once you know the browse node IDs for subject areas you're interested in, you can bypass the standard search forms and perform narrow, specialized searches from a URL.
The first trick is finding the browse node IDs. They're not quite as easy to come by as ASINs because they don't appear in URLs as frequently. They also don't seem to follow any logical pattern, so there's no way to guess. Instead you can browse the "category tree" that Amazon has made available through their Associates program. You don't have to be an associate to browse the tree, however; you can reach it at http://associates.amazon.com/exec/panama/associates/resources/build-links/amazon-recommends/browse-bestsellers.html.
Once at this page you'll see a list of the highest product category levels: Baby, Books, Camera, Cell Phones, and so on. Click Books and you'll start to see browse node codes in the URL; in this case:
http://associates.amazon.com/exec/panama/associates/resources/build-links/[RETURN]
amazon-recommends/browse-bestsellers.html/086-9645301-8693838?t=&node=1000
               [RETURN]
&mode=browse-books
The only section we're concerned with is the node= and its value. The node here is 1000 and represents all books. On this page the categories are refined further under books: Arts & Photography, Biographies & Memoirs, Business & Investing, etc. Click on the entry "Science Fiction & Fantasy." Once again you'll see a new node value in the URL, 25. You can continue to drill this way and find IDs. As you do so, you'll soon find yourself a few levels deep, for example, All Products Books Subjects Science Fiction & Fantasy Fantasy Magic & Wizards. Checking the URL, the node ID in this case is 16205.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Power-Search for Books
Fine-tune your book searches with the Advanced Search form and Power Search queries.
The search form on the lefthand side of the Amazon home page is the most widely used way to find items. A couple of keywords can get you surprisingly close to what you're looking for. But if you'd like to do more sophisticated searches, you'll have to use the Advanced Search form or learn Amazon's Power Search syntax.
Amazon offers an Advanced Book Search form on their web site at http://amazon.com/exec/obidos/ats-query-page. This form allows you to search for a specific title, author, subject, ISBN, or publisher. And you can narrow your search by format, reader age, language, or publication date.
The query in Figure 1-15 will return all books by O'Reilly with the word "Mac" in the title.
Figure 1-15: Amazon Advanced Search page
Beyond Advanced Search, there's a way to perform even more finely tuned searches of the product database: Power Search. A Power Search uses a special query syntax to define what you're looking for. The syntax consists of field/value pairs that are put together with connecting words like "or" or "and." To perform the same query, we'd include the publisher and title fields with the appropriate values:
publisher:O'Reilly and title:Mac
To run the search, paste this into the Power Search form at the bottom of the Advanced Search page at http://amazon.com/exec/obidos/ats-query-page#powersearch.
There are several fields available to help narrow your search:
asin
author
author-exact
author-begins
isbn
keywords
keywords-begin
language
pubdate - [before, during, after] date
publisher
subject
subject-words-begin
subject-begins
title
title-words-begin
title-begins
With all of these options, you can see how queries could quickly become very specific. Let's say we wanted to find not only O'Reilly's books with the subject "Mac," but also all O'Reilly books where the title starts with "Mac":
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Search Amazon from the IE Address Bar
A fast way to search Amazon via your Windows Internet Explorer address bar.
The Internet Explorer address bar is usually where you enter a URL to browse to a web site. This hack adds the ability to do Amazon searches from the same place. Instead of visiting the site, finding the search form, typing your query, and hitting the button, you can simply type amzn [ search term ] to get the same results.
This is extremely simple to set up, and just requires adding an entry to your Windows registry. Instead of mucking around with a registry editor, you can put the required settings into a .reg file. Once there, it's just a matter of double-clicking to install. Here are the steps:
  1. Close any open Internet Explorer windows.
  2. Open up Notepad (Start Programs Accessories Notepad) and add the following code:
    Windows Registry Editor Version 5.00
    
    [HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\SearchUrl\amzn]
    
    @="http://www.amazon.com/exec/obidos/external-search/[RETURN]
    mode=blended&keyword=%s"
  3. Save the file as AmazonSearch.reg on your desktop.
  4. Double-click the file and confirm that you want to add the information to your registry.
Restart Internet Explorer, and your Amazon search shortcut should be available.
Once installed, it's just a matter of typing amzn in your address bar followed by your search term, as shown in Figure 1-16. It works the same way as entering a URL. Just hit Enter or click the Go button.
Figure 1-16: Searching Amazon from the IE address bar
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Search Amazon from Any Web Page in IE
Searching Amazon from any web page can be as simple as highlighting and clicking with an Internet Explorer context menu.
If searching Amazon from your address bar [Hack #10] isn't your style, you may find it helps to have context. Imagine this: you're reading an article on your favorite news web site about the latest tech trend: overclocking. It sounds like something you'd like to try, and you wonder if there are any books on the subject. You highlight the word, right-click, choose "Search Amazon" from the menu, and a new window opens with your answer. You can make this happen with a little JavaScript and a new registry entry.
First, the JavaScript. This bit of code will open a new browser window and plug the highlighted text into a URL. This code needs to be in a file somewhere on your computer where it can be accessed from the browser, and won't be deleted in a fit of spring cleaning. You could even create a new folder for it, c:\scripts\. If you have another location in mind, be sure to change any references to c:\scripts\ in the following code.
Create a file called AmazonSearch.html and add this code:
<script language="JavaScript">
var searchURL = new String("http://www.amazon.com/exec/obidos/[RETURN]
external-search/mode=blended&keyword=");

var w = window.external.menuArguments;
var d = w.document;
var s = d.selection;
var r = s.createRange(  );
var term = new String(r.text);

window.open(searchURL + term);
</script>
Save it in the c:\scripts\ directory.
Next you need to add some information to your Windows registry to let Internet Explorer know where to find AmazonSearch.html, and when exactly it should be executed. You could open up a registry editor and add values manually, but it's just as easy to put the information into a .reg file and add it by double-clicking. Create a new file called AmazonContext.reg and add the following code:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\MenuExt\
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Add an Amazon Sidebar Search to Mozilla
Mozilla's built-in search engine sidebar provides a unique way to organize search results from several sources. Using Amazon's API you can add Amazon as a source with a few quick steps.
The Amazon Web Services API has opened up a direct door to Amazon's catalog. Developers can now search and browse Amazon programmatically, and reformat search results in any way they see fit.
Mozilla (http://www.mozilla.org) is an alternative web browser that has been designed from the ground up to be an application platform for working with the Web. Mozilla's sidebar offers a way to search several different search engines. For example, Mozilla comes with Google and dmoz.org installed in the sidebar, as you see in Figure 1-20.
Figure 1-20: Mozilla sidebar search engine selection
With one search field, you can search these sites individually or mix the results from both at the same time—all the while keeping the results separate from the main browser window. It's a new way to search that removes the problem of paging back and forth between search results, or trying to keep track of several open windows.
The Mozilla-Search plug-in interface allows you to add your own entry to the list of search engines available. Although Google and dmoz.org are there when you install Mozilla, that doesn't mean your search engine selection can't grow. It just takes some understanding of both Amazon and Mozilla to get them talking to each other. Once you set up this hack, you'll have an entry for Amazon in your list of available search engines.
There are two pieces to setting up the sidebar. One file resides locally and tells Mozilla how to search Amazon. The other file resides on a public server and formats the search results for Mozilla.
The local file uses the Mozilla-Search plug-in definition format. Create a file called amazon.src and add the following code:
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Chapter 2: Controlling Your Information
This chapter describes all the ways information flows into Amazon, and how that information can be fine-tuned and controlled. It also offers tips for working with your account at Amazon while maintaining your privacy and security.
Amazon user accounts provide a consistent, personalized experience. Understanding how, when, and why you should log in and out of your Amazon account will help you control that experience.
The general perception of identity on the Web was summed up well in a famous cartoon from the New Yorker: a dog in front of a computer turns to another dog and says, "On the Internet, nobody knows you're a dog." If every web request were completely anonymous, though, features like 1-Click buying, personalized recommendations, or wish lists would be impossible. At the very least, personalized web applications like Amazon need to know you're the same dog each time you visit.
Like most web applications, Amazon's answer to the Web's inherent anonymity is user accounts. By identifying yourself with an email address and password, Amazon is able to save your information for subsequent visits.
Exactly what information does Amazon collect, save, and associate with your account? Anything you explicitly type into a form will be saved. That includes your name, billing and shipping information, items you purchase, reviews you add, wish list items, and items you've seen. This may sound like an Orwellian disaster waiting to happen, but in exchange for this information, Amazon provides a unique, customized buying experience. If you were to stop by your corner store on a regular basis, the person behind the counter would eventually get to know your tastes and offer help and recommendations based on your buying patterns. Amazon does the same thing—for tens of millions of people. Some of the features available to registered users include:
  • Personalized Product Recommendations [Hack #14]
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Hacks #13-26
This chapter describes all the ways information flows into Amazon, and how that information can be fine-tuned and controlled. It also offers tips for working with your account at Amazon while maintaining your privacy and security.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Understand Identity at Amazon
Amazon user accounts provide a consistent, personalized experience. Understanding how, when, and why you should log in and out of your Amazon account will help you control that experience.
The general perception of identity on the Web was summed up well in a famous cartoon from the New Yorker: a dog in front of a computer turns to another dog and says, "On the Internet, nobody knows you're a dog." If every web request were completely anonymous, though, features like 1-Click buying, personalized recommendations, or wish lists would be impossible. At the very least, personalized web applications like Amazon need to know you're the same dog each time you visit.
Like most web applications, Amazon's answer to the Web's inherent anonymity is user accounts. By identifying yourself with an email address and password, Amazon is able to save your information for subsequent visits.
Exactly what information does Amazon collect, save, and associate with your account? Anything you explicitly type into a form will be saved. That includes your name, billing and shipping information, items you purchase, reviews you add, wish list items, and items you've seen. This may sound like an Orwellian disaster waiting to happen, but in exchange for this information, Amazon provides a unique, customized buying experience. If you were to stop by your corner store on a regular basis, the person behind the counter would eventually get to know your tastes and offer help and recommendations based on your buying patterns. Amazon does the same thing—for tens of millions of people. Some of the features available to registered users include:
  • Personalized Product Recommendations [Hack #14]
  • 1-Click Buying [Hack #15]
  • Persistent shopping carts
  • Wish Lists [Hack #18]
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Fine-Tune Your Recommendations
As Amazon gets to know your tastes, it makes recommendations about products you might like. A few quick steps can ensure that your recommendations are on target.
One of the features that makes browsing at Amazon unique is their exceptional ability to personalize the experience. Amazon analyzes your purchase history and makes recommendations of other products you might like based on your unique tastes. You can begin browsing your personal recommendations in Amazon's Your Store section. You can find it by clicking the tab that says "Your Name store" from the main menu.
Reactions to recommended products are inevitably polarized, ranging from "that's perfect!" to "that's waaaay off!" The key to getting good recommendations is Amazon having data about what you like, and even if you've never purchased anything there, you can give Amazon plenty of data about your interests.
To reach the fine-tuning features, go to Your Store and choose "Improve Your Recommendations" from the list of links on the lefthand side of the page. This will lead to the appropriately titled Improve Your Recommendations page, shown in Figure 2-2. The following features can be accessed from this page.
Figure 2-2: Improve Your Recommendations
If you're creating an account for the first time, the first thing you'll see is a link that leads to Amazon's Recommendations Wizard. This is a getting-to-know-you process that asks about your favorite subject areas or categories and some keywords for various departments, and lists some specific products for you to rate. If you're a long-time customer, running through the wizard is a good way to start refining your recommendations. On the Improve Your Recommendations page the wizard is called "Select Your Favorite Areas." Just click Continue under that heading to get started.
Your Amazon History is a virtual collection of products associated with your account. It includes products you've purchased, of course, but also items you've rated, items in your wish list, or items you've told Amazon something about in some way. Each item in your Amazon history can have information associated with it that you set:
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Enable 1-Click Buying
Zip through the checkout process and indulge the impulse buyer within by setting up push-button buying.
1-Click buying is the impulse buyer's dream—or nightmare, depending upon your point of view. Once activated, you can skip the standard checkout process and buy something by clicking a single button. It takes just a few clicks to set it up.
At the top of every page at Amazon you'll find a consistent set of options in the Amazon Toolbar, shown in Figure 2-5.
Figure 2-5: Amazon Toolbar
From this toolbar, choose "Your Account" to see your preferences page. In the section titled "Personal Information," choose "View or Change 1-Click Settings." (You'll be asked to sign in if you haven't already.)
Your browser must have cookies enabled if you want to use 1-Click buying.
From this page you'll see your 1-Click status (on or off) in a box at the upper righthand corner of the page. Once you've verified your 1-Click shipping address and payment information, you can enable 1-Click by signing in from any product detail page. Under the "Add to Shopping Cart" button, you'll find "Sign in to turn on 1-Click ordering." Once signed in, you're all set to have products shipped to your house with the click of a button.
There are no price limits on 1-Click buying, so you could find a $9,000 plasma HDTV-ready flat-panel TV on your doorstep with a few careless clicks. But once you've ordered an item with 1-Click, you have 90 minutes to cancel it or add more items. Just click "Your Account" from the top of any page to edit your order.
You can send gifts with 1-Click as well. Just add an address on your 1-Click settings page, click "edit," and be sure that "Include address in your 1-Click drop-down box" is checked. You'll then have the option to choose the target address from a drop-down box before your 1-Click action.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Set Up a Group Account
Amazon's Corporate Account feature lets a business provide a single point of billing for its employees. You can use this same system to organize the purchases of everyone in your family.
If it came down to it, there's probably someone in your family you could call the Purchase Manager. You can formalize that title on Amazon by setting up a corporate account for your family, as Jim Roche at Amazon suggested. Even though they're called corporate accounts, you don't have to be a corporation to start one. Any small business, organization, or family can set one up to let a group of people make purchases with one or two people controlling the billing and shipping information.
Standard Amazon accounts are intended for a single individual. Corporate accounts let you group several standard accounts together to let one of the accounts handle billing and shipping information.
To create a group account, visit the corporate accounts home page, http://amazon.com/corporate.
Click "Open a Corporate Account" to begin the process. Once created, you can manage your account on the page you see in Figure 2-6 and invite people to join the account using their email address. Each person will receive an email asking them to confirm their invitations.
Figure 2-6: Corporate Accounts management page
If the person you invite doesn't already have an account with Amazon using the email address you sent the invitation to, they'll have to create a standard account to join. Another option is to resend the invitation using their Amazon-related email address.
Each person participating in the account is either an Account Manager or an Account Buyer. Managers have certain privileges that buyers don't have. They can:
  • Add participants
  • Change payment and shipping information
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Create an "About You" Area
By letting other Amazon customers know a little bit about you, you'll add some context and personality to your lists or reviews.
An "About You" page is like a home page for you at Amazon. Any time you add a review, create a Listmania! list [Hack #41], guide [Hack #37], or wish list [Hack #18], it will be accompanied by a link to your About You page. If someone sees something you've contributed to Amazon and wants more information about you, they can visit your page to learn more.
To customize your page, make sure you're logged in [Hack #13], click the Your Store tab from any page, and choose "Your About You Area" from the lefthand side of the page.
Click "Edit About You" to add or change information. If it's your first time setting up your page, you'll see a form with a few options you can set:
Name
This should be your real name. It will be used to personalize Amazon. You can set whether or not other people can see it with your Identity Preferences.
Nickname
This is a name that will appear instead of your real name in some public spaces. It's also used as your name for any Amazon Chat spaces.
Identity Preferences
This lets you set whether or not your name is available to other people on your About You page and other nonanonymous contributions to the site. You can set your nickname to override your name for public spaces. Or you can choose to reveal your name only to those people you give the special status Amazon Friend [Hack #42].
Email Preferences
You can make your email address available to everyone on your About You page, or only to a select few Amazon Friends. With the Amazon Friends option selected, anyone searching for your wish list with your email address will be able to find it.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Create a Wish List
Amazon's catalog is your oyster! Save those items you want in once place and let everyone know what you really want.
Remember those novelty socks you got as a gift from your aunt on your last birthday? The thought was nice, but if she'd known you would have preferred a Lord of the Rings DVD instead, everyone would have been happy. Your aunt would have known she got exactly what you wanted, and you'd think of her fondly as you watched Frodo battle evil. Amazon's Wish List feature lets you set up a list of products you can share. The wish list also stores your address so your aunt won't have to try to remember where you live.
Even though your address is associated with your wish list, people buying gifts won't ever know your exact address. The most they'll see is "Ships to Portland, OR" (or wherever you call home).
Wish lists can be used for more than just accurate presents; they can also help nonprofit organizations. If you visit Amazon's charity page (http://www.amazon.com/exec/obidos/tg/browse/-/557206/), you'll find that several organizations like Toys for Tots and Habitat for Humanity have public wish lists of items they need. Buying through their wish list means your donation will make it to the proper address, and you know it's something they've specifically noted they need.
You can create a wish list by clicking the "Add to Wish List" button on any product detail page. It's located on the righthand side of the page under the "Add to Shopping Cart" button. Alternately, you can click "Wish List" from the top of any page. From there you can browse items to add to your wish list.
Once an item is on your wish list, you can set the quantity you'd like ("Desired") and include comments (see Figure 2-7).
Figure 2-7: Edit Wish List page
You can keep purchased items a surprise by leaving the default "Show" setting at the top of the page at "All items." Or you can choose "Only purchased" from the drop-down menu to see what's been purchased from your list.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Add Items to a Wish List Remotely
A simple HTML form allows your visitors to add items you mention to their own wish lists.
If you list items on your own web site and you'd like to let people add them to their Amazon wish lists with the click of a button, you can do this with a simple HTML form.
To set up the form, you need to know a product's ASIN [Hack #1] and (optionally) an Amazon associate tag Section 5.2.
<form method="POST" [RETURN]
    action="http://www.amazon.com/o/dt/assoc/handle-buy-box=insert ASIN ">
<input type="hidden" name="asin.insert ASIN" value="1">
<input type="hidden" name="tag-value" value="insert associate tag"> 
<input type="hidden" name="tag_value" value="insert associate tag">
<input type="submit" name="submit.add-to-registry.wishlist"[RETURN]
       value="Add to Amazon.com Wish List">
</form>
Just fill in the ASIN and affiliate tag in the code and include it on any web page. If someone has the Amazon identity cookie or is logged in, the item will be added directly to their wish list when they click the button. Otherwise, they'll be required to sign in at Amazon before the item is added.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Add Multiple Items to a Wish List at Once
Speed up the process of adding items to your wish list with a bit of scripting.
Creating a wish list with 15-20 products is usually a slow process, adding one or two items while you're browsing. Amazon doesn't offer an interface for adding multiple items to a wish list, but you can build one with a bit of scripting. This PHP script accepts a comma-separated list of ASINs and adds them to your wish list all at once.
This script relies on automatic form posts, and there are some external PHP tools to speed up this kind of development. Snoopy for PHP is an open source class that handles HTTP requests. You can download a copy from SourceForge (http://sourceforge.net/projects/snoopy/) and include it in the same directory as this script.
This script runs as a web page and presents a simple form for entering ASINs. Once you enter a list of ASINs, this script performs three main actions:
  1. With the Snoopy PHP class, it simulates a Sign In form post at Amazon with your email address and password to retrieve a session ID.
  2. It then loops through the ASINs.
  3. For each ASIN, it uses Snoopy to send a form post with the variables from the remote wish list form [Hack #19].
Because you need to be signed in to add items to your wish list, the key to this script is obtaining a 17-digit Amazon session ID [Hack #13] that is associated with your account when you visit the site. Be sure to include your email address and Amazon password in the following code. Your Amazon password will be in the source of the file, so make sure you're the only one with access. You can also insert an associate tag Section 5.2.2 if you have one, to make sure you get a commission on your wish list purchases.
<?php
# add_wishlist_items.php
# Adds multiple items to an Amazon Wish List
# Usage: A PHP page called via web browser

$aff_tag = "
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Organize Your Wish List by Priority
Amazon provides a few ways to sort your wish list, but missed an important one: sorting by which items you want most.
When I sat down to create my Christmas list in November of 2002, I decided to use my Amazon wish list. I added all the books, CDs, and DVDs that I had been craving to my list. Next, I went to the "Your Wish List" page, where I planned to rank the items on my list. To my surprise, I found that Amazon doesn't allow you to rank your wish list.
Instead, all you can do is sort the list by (a) date added, (b) last updated, or (c) price. Even worse, the default sorting is by date added, and, since the items I wanted the most were the first ones I added, they ended up at the bottom of my list. (Amazon does provide a "Comment" field for each wish list item, so I initially thought I could store my ranks as comments, but Amazon doesn't let you sort by comment either.)
In search of a solution, I took a look at Amazon Web Services (http://www.amazon.com/webservices) and found that I could build my own simple application that adds ranking ability for Amazon wish lists.
Using the Wish List Ranking application is simple. First, fill out the registration form (http://www.yoon.org/amazon/register). The only tricky part is that you have to enter your Wish List ID manually [Hack #18]. The FAQ (http://www.yoon.org/amazon/faq) includes instructions on how to find your Wish List ID. Then, as you can see in Figure 2-8, the application fetches your wish list from Amazon.
Figure 2-8: A Wish list pulled from Amazon
As with any third-party service that requires registration, always use a different email and password combination than you use for your Amazon account. It's easy to use the same combination to save space in your memory, but you may be giving away the key to your account.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Set Email and Messages Preferences
You can decide how often Amazon contacts you by setting your preferences.
If your primary method of communication on the Internet is email, you can have Amazon send information to your inbox. Amazon sends several different types of email, and you can manage your settings at any time by clicking "Your Account" at the top of any page and scrolling down to the "E-mail Notifications" section. The different types of email are:
Alerts
Set a keyword for certain product categories at Amazon, and you'll receive an email when new products are available that match your criteria. For example, a "hacks" alert in books would let you know when this book was released. You can add an alert at https://www.amazon.com/exec/obidos/subst/alerts/signup.html/.
Delivers
Choose your favorite product categories at Amazon and receive recommendations, reviews, and interviews by editors from those categories. Figure 2-10 shows the Amazon.com Delivers category selection form.
Figure 2-10: Amazon.com delivers category selection
Available to Order notifications
If you're browsing around Amazon and spot an item that is out of stock or that Amazon doesn't know the release date for, you can sign up to be alerted when it's available.
New for You
This is an email version of the site feature "New for You." It lists new products. The web version is available at http://amazon.com/o/tg/new-for-you/new-for-you/-/main/.
Special Occasion Reminders
These are email alerts that you specifically set up to remind you [Hack #24] of important days.
Additional content appearing in this section has been removed.
Purchase this book now or read it online at Safari to get the whole thing!
Get Movie Showtimes
You can use Amazon to plan your evening by finding out when, where, and what movies are playing in your local theaters.
It's Saturday afternoon—time to make plans for the evening. Of course the Web holds all the information you need to figure out what to do. Surprisingly, though, Amazon.com is among the sites that can help you out. One of the lesser-known features Amazon provides is movie showtimes. Figure 2-11 shows the home page of the Movies category (http://www.amazon.com/movies). When you provide Amazon with your zip code, you'll see a list of the theaters in your area along with movies and times they're playing.
Figure 2-11: Amazon movie showtimes
The zip code form is an interface for creating a URL that gets th