Backup of David's Livejournal

Amazon Still Hates Your Life(stream)


Wow, it's hard to believe that even in 2010 the good folks at Amazon are still blocking word-of-mouth advertising via lifestream.

A little history: A lifestream is a voluntary record of your activities online.  Generally they're made from Atom and RSS feeds.  Those feeds generally are lists of dates and urls, so that you can make a note that "at that time, I was there."

Smart companies make user activity feeds for you.  Like FourSquare, GoodReads, Blippr.  They provide the feeds, and if you use them, then your friends see what you want to share, and they might want to spend money in that direction, too.  Everybody wins.

Amazon doesn't want to win. Not in this way.

It seems they never did.

Even when they bought Shelfari, they refused to create user activity feeds for two years, and counting.  We asked for it.  And well over 50 replies later, Amazon/Shelfari has nothing to show for it.

Amazon's got wishlists, right?  Isn't the whole point of a wishlist that you share it with friends?  A wishlist is a natural for a lifestream, too.  It'd be handy to make note that "back in 2006, I wanted that book on Winning With Subprime Mortgages."

Amazon never made it easy to associate the time you added an item to your wishlist.  Which is dumb.  The data is there.  And user feeds should reflect user activity.  We care about when we were doing stuff.

Well, I fixed that problem for Amazon once. (Same link as the last one, just under the Amazon logo.)

But they broke it again.  Now the URL in the old fix needs authentication.  And it's even harder to extract the date from their services' results for your feed.  There are a few Yahoo Pipes that list the few most recent wishlist items, but none of them associate the items with when you wished for them.

I fixed the problem again.  Here's how to make an Amazon Wishlist Feed, complete with when you wished for each item.

def Make_amazon_wishlist_feed( access_key, secret_key, list_id ):
domain = "xml-us.amznxslt.com"
base_url = "http://%s/onca/xml" % domain
params = [ ( 'AWSAccessKeyId', access_key ),
( 'ListId', list_id ),
( 'ResponseGroup', 'ListFull' ),
( 'ListType', 'WishList' ),
( 'Operation', 'ListLookup' ),
( 'Service', 'AWSECommerceService' ),
( 'Sort', 'DateAdded' ),
( 'Timestamp', time.strftime("%Y-%m-%dT%H:%M:%SZ", time.gmtime() ) ) ]
params.sort()
url_params_string = urllib.urlencode( params )
string_to_sign = "GET\n%s\n/onca/xml\n%s" % ( domain, url_params_string )
signature = hmac.new( secret_key, string_to_sign, hashlib.sha256 ).digest()
signature = base64.encodestring( signature ).strip()
urlencoded_signature = urllib.quote_plus( signature )
url_params_string += "&Signature=%s" % urlencoded_signature
url_handle = urllib2.urlopen( '%s?%s' % ( base_url, url_params_string ) )
response_dom = minidom.parse( url_handle )
for i in response_dom.getElementsByTagName( "ListItem" ):
pubDate = Get_node_text( i.getElementsByTagName( "DateAdded" )[0].childNodes )
title = Get_node_text( i.getElementsByTagName( "Title" )[0].childNodes )
url = "http://amazon.com/gp/product/%s" % \
Get_node_text( i.getElementsByTagName( "ASIN" )[0].childNodes )

Inside that "for" loop at the bottom, you can see the three identifiers you'll need for the individual items of your feed, the pubDate, the item's Title, and its URL. With that, you're good to go.

Seriously, it's ridiculous that Amazon doesn't just make a feed right there at your wishlist.  There should be the little orange feed indicator right next to the URL in the URL bar.