Amazon.ca is amazing. Again.

I’ve written before about how much I like Amazon.ca, the Canadian arm of Amazon.com. Today they’ve blown my mind again.

On Sunday night I was finishing up the last couple of chapters of Long Way Round, a book by Ewan McGregor and Charley Boorman about a motorcycle trip around the world (it’s a very good read; they’re both entertaining writers, and they had an interesting adventure).

McGregor mentions a couple of times that the book Jupiter’s Travels was an inspiration for their trip. Being an afficianado of round-the-world travel tales, I decided to order a copy for myself. At 1:30 a.m. on Monday morning.

The book shipped on Monday. It arrived at my doorstep, via regular shipping, this morning. Just slightly more than a day after I placed the order.

Google Maps says it takes 18 hours to drive from Mississauga (where Amazon’s warehouse is) to Charlottetown. That leaves only about 15 hours for the “logistics” part of the transaction. That, to me, seems simply amazing. I can’t imagine how they would get the book to me any faster.

Better iPhoto to Drupal via AppleScript

I’ve updated my system for uploading photos from iPhoto to a Drupal image gallery. The original script required both an AppleScript and a PHP script. The updated script does the same thing, but without the need for PHP; it also handles upload of multiple images at the same time.

To install the updated script, here’s what you need:

  • The updated iPhotoToDrupal AppleScript. Save this, and then copy the text into Script Editor; set username, password and other variables to appropriate locations on your local system (including the edit[taxonomy][], which is admitedly kludgey), and then save the AppleScript in the Library:Scripts:iPhoto Scripts folder under your home directory. You can rename it something useful like “Upload to Drupal” if you like.
  • As before, if you don’t have the Script Menu utility installed on your Mac, go and grab it; it lets you call the AppleScript from a pop-down menu in the menubar.

Assuming you’ve got everything configured properly, you should now be able to select one or more images in iPhoto, call the script (from the Script Menu under iPhoto Scripts) and the photos should appear shortly thereafter in the appropriate Drupal image gallery.

As always, comments and suggestions welcome.

Logging in to Drupal from AppleScript

I found that it’s relatively easy to login to Drupal from AppleScript by using cURL. I created a sample script to show how; grab DrupalFromAppleScript, load it into Script Editor, enter values for your username, password and Drupal URL, and you should be able to get it to login to your site.

This will only get you logged in of course — you’ll have to amplify the script to make it do anything useful (like uploading content, grabbing information, etc.)

iPhoto to Drupal via AppleScript and PHP

NOTE: I’ve released an updated version of this script that uses AppleScript only.

Here’s a hack I threw together to allow me to post images from iPhoto into my Drupal image gallery. It’s a two-step process: first, there’s an AppleScript that grabs the photo information from iPhoto and puts it into a temporary file; this script then calls a PHP script that takes this information and uses cURL to do an automated login to my Drupal site and uploads the photo.

There are probably much more elegant ways of doing this, but this one has the advantage of being relatively simply and easy to modify.

Here’s what you’ll need to make this all work:

Once you’ve got all of the above downloaded, installed, and configured, uploading a photo from iPhoto to Drupal is as simple as selecting a photo, and then selecting the iPhotoToDrupal script from the Script Menu:

Note that you’ll need to have at least an image “title” defined in iPhoto, as this is a required field in Drupal; an image description is optional.

Assuming everything is configured properly, you should find the selected photo uploaded to your Drupal image gallery a few seconds later.

I welcome comments on the code and the approach.

iPhoto to Drupal via Gallery?

I use iPhoto to manage my photos with my iMac. I use Drupal as a content management system for several websites I maintain. Drupal has an “image gallery” function that I use a lot. I also use Gallery to maintain some online photo albums (like this one).

Gallery has a neat iPhotoToGallery plug-in that allows photos, with titles and comments, to be easily exported to an online gallery.

I’d like to have the same thing for Drupal, and it occurs to me that the easiest way to do this would be to create a Drupal module that implements the Gallery Remote Protocol; this would mean that all of the Gallery client-side tools could be used to maintain Drupal image galleries.

Pages