#!/usr/bin/env nawk -f # To use: # 0. Edit the string in isbn_url below to point to your favorite # online book database. The %s in it is where the ISBN should # appear. You can find out what to put here by going to the # page for some book you know, looking at its URL in your browser, # and changing the ISBN to %s. Depending on the site, bigger # changes to this script might be needed. # 1. Download your Amazon wishlist as an HTML file. # 2. Run this program with that file as the input: # nawk -f wishlist.awk the-amazon-wishlist.html >my-new-wishlist.html # (changing the-amazon-wishlist.html to the actual filename from step 1.) # 3. The output is a new HTML file with only the wishlist entries # that look like books (as far as this script can tell), pointing # into your favorite book database. (It should be easy to change # this to do something with the non-book entries, too.) # # By Darius Bacon # This program is in the public domain. # It could become useless any time Amazon decides to change their page layout. # It's also a sleazy hack that could fail anyway; you should check the # output page before deleting your original wishlist entries. function isbn_url(isbn) { return sprintf("http://www.booksense.com/product/info.jsp?isbn=%s", isbn); } BEGIN { FS = "/"; printf("\n"); } function spill() { if (isbn) { printf("
  • "); printf("%s\n", isbn_url(isbn), title); if (comment) printf("
    %s\n", comment); printf("
  • \n"); } isbn = comment = ""; }