T
oday I had a 40% off coupon at Borders. I also have
tons of things on my many Amazon wish lists*. What I wanted was a way to quickly print out my wish list, but without all the crap that Amazon has on their webpage. All I want is the title, author(s) and price. No graphics, no tables, &tc. I had about an hour before I had to head out the door. I thought: This is a job for Automator, surely. And it was.
With time to spare, I found the item to grab webpages, figured out how it parse webpages into paragraphs, and then monkeyed with a custom python script enough to make a reasonable list that was ready to print. Worked great. When I got home, I added a few extra things to clean up the text some more and fix a bug or two. Much later, I made sure it worked if you were an anonymous user or a logged in user, and made it work with CD/DVDs, and other products.
You can download the script:
Amazon Wish List to Text (let's call this version 1.0).
Update 8/19/2009: In case anyone is wondering: This version no longer works due to a formatting change at Amazon. I'll sit down and write a 2.0 version if you don't write one first and post it to the discussion below.
To get it set up for easy access:
- Enable the script menu, if it's not already there (in the upper right hand side of the menu bar): Run the AppleScript Utility, often found in the /Applications/AppleScript folder. Check the "Show Script menu in menu bar" checkbox. Quit the AppleScript Utility program.
- Open the Safari scripts folder, by going to Open Scripts Folder > Open Safari Scripts Folder in the scripting menu.
- Place in script, and close the scripts folder window.
At least currently, this only works when viewing lists in the "Normal"-sized view.
The workflow requires that the wish list Safari window be the foremost Safari window, and it will append the text into the foremost TextEdit document. I did that so I could allow multi-page wish lists to keep appending to the same TextEdit doc until I was done. If TextEdit isn't running, it'll open and start a new document with the text.
The output looks like the following example (although there are no line numbers in the real output):
1 Cephalopod Behaviour (Hanlon, Messenger)
2 The Evolution of Thought: Evolutionary Origins of Great Ape Intelligence (Russon, Begun) $127
3 CD: This American Life: Lies Sissies & Fiascoes (Ira Glass) $13
4 Weber Q 200 Portable Propane Grill, Silver Series (Weber) $179
5 IRoast2 40011 5-2/7-Ounce Coffee-Bean Roaster, Black (Hearthware, INC) $182
6 Rock 'n' Roll: A New Play (Tom Stoppard) $10
In the current version of the script, multiple authors are only listed by last name, but single authors get their full name. Prices are rounded to the nearest whole dollar, if available, and there's a 120 character line limit (the whole line, price, authors and all). You can change the length easily at the top of the script. Just double click on the script to bring up Automator. Change the value, then save.
The script is editable, so fix bugs, modify to your taste, etc. The heart of it is a simple Python script. If you want to post fixes or improvements to the script, by all means do so and I'll incorporate stuff. It's provided as-is as freeware. (As such, I take no responsibility if this does any harm. Use at your own risk.)