If you happened to buy books from Amazon.com (or, in my case, Amazon.de) and maybe used the recommendation engine and the wishlist (and and and ...) then there will be lots of data about your books on the Amazon website. Have you ever thought about organizing your library with a different tool? May it be Google Books or LibraryThing or Shelfari, you will have to export this precious big amount of data from Amazon to the other service. Luckily, some intelligent people invented ISBN, so you basically need to extract a list of ISBNs to identify the books (neglecting your reviews and tags for now). Not that luckily, Amazon doesn't offer such export functionality to the layman. Searching the internet yields a Greasemonkey script that enables you to export wishlist content - but no ISBNs, so import into other services is not so easy.
The solution is to save each website of "your purchases" (or other such lists of books) as HTML file and let a smart script do the extraction work. This way, you're not violating Amazon's terms of service (which most likely don't allow any robots scraping the website) and on the positive side, it works.
Here is my python script, which you can also download here (in a better version):import sys, reTo run this script, you need a Python interpreter. On most common GNU/Linux systems, those are installed or easily installable, for example by "apt-get install python" on Debian-based systems.
asinRegExString = "<tr valign=middle id=\"iyrListItem([A-Z0-9]{10})\">"
asinRegEx = re.compile(asinRegExString)
filename = sys.argv[1]
f = open(filename,'r')
asinlist = []
for line in f.readlines():
match = asinRegEx.match(line)
if match != None:
asinlist+=[match.group(1)]
f.close()
print "\n".join(asinlist)
I have tested it with Amazon.de and the "purchased books" website but I guess it would work equally well with Amazon.co.uk and Amazon.com. As always, leave a comment if it worked for you or not. If it doesn't work or if you have different needs (like, extracting ISBN and name and price) this will be easily possible by altering the regular expressions in the script (easy for a programmer, not that easy for anyone else).
<!--
google_ad_client = "ca-pub-7652445919413097";
/* Howto with Software */
google_ad_slot = "2567987613";
google_ad_width = 468;
google_ad_height = 60;
//-->
I used this to import all books I bought via Amazon into my Google Books library which I use to maintain a list of all books I own. The nice thing about Google Books, on the other hand, is their XML export feature, which I commented on earlier.
