iPhoto to WordPress Ruby Script

I maintain a WordPress blog that’s primarily an extension of iPhoto, and the various iPhoto plugins (Photon by Daikini, Photon by Orby, WordPress Export) I’ve tried over the years seem to have stopped being maintained, stopped working, or both.

Which is fine, they never worked exactly the way I wanted them too anyway.

So, I wrote one.

In Ruby, with some help from rb-appscript

Unlike like the other iPhoto export options, this one lives in your Scripts menu and automatically creates (and opens!) a draft post containing all the selected images.

Download send_selected_photos_to_wordpress.rb

“It’s surprisingly short and effective.” – Peter Cooper

14 Replies to “iPhoto to WordPress Ruby Script”

  1. Great work!
    I don’t know ruby but I’m willing to dive in. Looks easy from your code :-).
    Do you have a hint for me: is a resize option feasable?

    Thanks

  2. Edwin, Based on what I’ve seen thus far, WordPress will do some resizing (at least create a thumbnail and ‘medium’ size version). The first step is to load those WordPress-created images into the post that this script makes.

  3. Thanks!
    I use a Mail-to-WorPress solution now, called postie. With mail from within iPhoto you get the option to choose a size for the pictures. That’s why I was thinking along the line of resizing first. I’ll try your solution first.

  4. I followed the directions in the rb file but I don’t have a Script menu in iPhoto ’09 (8.1.1 (419)).

    How do I see the Script menu?

  5. Thanks very much for your work on this. I am having some trouble – below is the error message I am getting when running it from the terminal (as running through iPhoto does not work):

    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xmlrpc/client.rb:549:in `do_rpc’: HTTP-Error: 500 Internal Server Error (RuntimeError)
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xmlrpc/client.rb:420:in `call2′
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xmlrpc/client.rb:410:in `call’
    from /Library/Scripts/iPhoto/send_selected_photos_to_wordpress.rb:77
    from /Library/Scripts/iPhoto/send_selected_photos_to_wordpress.rb:66:in `each’
    from /Library/Scripts/iPhoto/send_selected_photos_to_wordpress.rb:66
    [Macintosh-50:/Library/Scripts/iPhoto] vicvega% ruby /Library/Scripts/iPhoto/send_selected_photos_to_wordpress.rb
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xmlrpc/client.rb:549:in `do_rpc’: HTTP-Error: 500 Internal Server Error (RuntimeError)
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xmlrpc/client.rb:420:in `call2′
    from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/xmlrpc/client.rb:410:in `call’
    from /Library/Scripts/iPhoto/send_selected_photos_to_wordpress.rb:77
    from /Library/Scripts/iPhoto/send_selected_photos_to_wordpress.rb:66:in `each’
    from /Library/Scripts/iPhoto/send_selected_photos_to_wordpress.rb:66

    Any insight appreciated.

  6. Setting everything up was easy enough following the install instructions, but now when I run the script nothing happens at all. How do you run it from terminal like john did? Any chance of status messages? Thanks.

  7. thank you very much for this fantastic script. it is just simple and works fine after some trouble with htaccess. how is it possible to put the today-date in the title of the wordpress blog? at the moment there are the filenames of the uploaded photos inside. i have no experience with RUBY. thanks, Torger

Leave a Reply

Your email address will not be published. Required fields are marked *