Working with AmazonHandler

As I promised a few weeks ago, I’ve spent a little more time working on AmazonHandler. The biggest problems people have had with it are that

  1. it requires a supporting script which has to be loaded from a fixed location on your hard disk, and
  2. there wasn’t an example of how to parse the output.

Number one is fairly trivial: you can either put the supporting script, SOAPXMLRPCHandler.scpt, in the standard location, which is in the computer’s /Library/Scripts directory—the one for all users, not your local version, though it should probably check both—or you can edit the InitSOAP subroutine to tell it to look for the script elsewhere.

Number two is harder, and I spent some time working through it last night. The trick is in knowing that various parts of the return have to be explicitly transformed either to lists or records before their parameters can be read. Once you do that, it’s fairly simple to parse the output.

I’ve hacked a quick demo script that is actually somewhat useful. Until I work out all the bugs, it will be available as a separate download; after that, I’ll probably bundle it with AmazonHandler. The script, Look Up Current Track in Amazon, talks to iTunes to get information about the currently playing track, then looks up the track’s album (or artist, if no album title is available) at Amazon, tells you what Amazon’s current price is, and offers you the option to go to Amazon’s page for the product should you wish to consider the option of purchasing it. So (buzzword version) this script integrates iTunes and Amazon using SOAP-based web services.

The script is available for download on my Scripts page.

DoNotCall.org = DoNotEmail?

As everyone has noticed, the national telemarketing “do not call” registry became open yesterday at donotcall.org. This MSNBC article says that the website stayed up, but the problem is mail. Every single phone number registered requires a confirmation email to be sent. Let’s see, 370,000 customers by noon, so figure about a million customers, each generating between one and three pieces of mail. Yeah, that would look like spam if I were operating a mail server.

So I’m not surprised that, although I registered our phones yesterday, I still don’t have my confirmation emails. I just I hope I get them within the 72-hour window.