December 30, 2024

I was playing around with adding some widgets to the site by using WidgetBox. They have an Amazon Wishlist widget which is pretty cool. It pulls products from your wishlist and displays them. However, it doesn\’t quite have all that I want. So, I started looking to see if I could make it myself.

The trick is to use Amazon Web Services to make a call to get the wishlist data. I\’ve never played around with this before, but it\’s not too hard. You have to call the List Lookup Service and then parse out the XML data (I used the DOM parser). It only pulls data for one page at a time which contains at most 10 items. So, what I did was call it the first time to get the total number of pages. Then pulled a random page. Then display random items from that page for a total of two web service calls. I also cache the page data so that it won\’t need to make a remote call everytime.

The web service calls need two parameters that you\’ll need to get: the list id and the web service subscription id. The creator of the Amazon widget has a page to determine the wishlist id from your full name. And you\’ll need to join AWS to get a subscription id (access key id).