time to look at pyAmazon

Another one of Mark Pilgrim’s little gems. Creating links for the Amazon affiliate program is tedious since you can’t look up the item from the “build a link” page. You have locate the item, get its ID, then login and create the HTML. What a pain.

I’m thinking that, given a title, pyAmazon can run the query and return the properly formatted link.

And it works.

>>>import amazon
>>>amazon.setLicense('get your own')
>>>pythonBooks = amazon.searchByKeyword('Python')
>>>pythonBooks[0].ProductName
u'Perl How to Program, Introducing CGI and Python (With CD-ROM)'
>>>pythonBooks[0].Asin
u'0130284181'

so now to just write a wrapper for this so I can pass it a title and have it return the ASIN with all the other stuff around it.

Thanks, Mark. Again.