Monday, January 24, 2005

AppleScript to send Trackback pings


There is a new version of ecto that includes scripting support. This menu allows you to run different types of scripts directly from ecto.


Since I have started doing most of my blog writting directly from ecto, I have not been sending trackback pings for my blog entries. Before this was working because when I created posts directly from pLog's web interface, pings would be sent automatically. I wrote an AppleScript that performs trackback pings directly from ecto.





This script has some interesting features:


  1. Automatic discovery of the trackback urls

  2. Generation of the excerpt from Apple's Summarize service

  3. It remembers posts that have had trackbacks sent before, and won't warn the user


Unfortunately, ecto doesn't support a way from AppleScript to get the permalink of a post, so I wrote the script to ask the user for the permalink.


Also, AppleScript did have the built-in support that I wanted, so I needed to use some other software:


  • mgrep - scripting addition that provides grep and regular expression support

  • curl - application that does the HTTP communication (installed with fink)


There are a couple of things that I would still like to do with this:


  1. Work better with ecto to get the permalink directly, instead of asking the user

  2. Remove dependancy on mgrep and curl

  3. Add better way to remember the list of post that trackbacks have been posted for. Now when the script is updated, the list is lost.

  4. When looking for trackback urls, only look at documents that have a mime type of text/html. (This will prevent the script from downloading large binary files.)





Update: Adriaan, the author of ecto, just added support for getting the permalink from the document. Thank you. I have updated the posted script.


Update #2: Here is a link to the text of the script.