API, Programming, WordPress

Share an iPhoto Library on the Web with WordPress

I recently needed to publish the contents of an iPhoto library online, so I wrote a script that converts the library to a WordPress site using WordPress’s REST API.  The script is available in my iPhoto-WordPress-Export repository on GitHub. Check it out, and then run it like this:

$ ./iphoto2wordpress.php --library=/path/to/photo/library --wordpress=https://www.example.com/

After prompting for a username and password, it will upload all of the library’s photos to the specified WordPress site. For each event in the library, it creates a post that includes a gallery containing all of the images from the event.  It will also convert any albums into categories, categorizing the photos themselves, not the posts. (For this to work, you will need to enable categories for attachments.)

If the script stops for any reason, you can restart it, and it will pick up where it left off. Depending on what it was doing when it stopped, you may have an orphaned attachment in your Media.

Posts are created as drafts and left for you to publish at your leisure.

I used this script to create DavidTewes.com.  (For back-story on what that site is and how it came to be, see this post.) Because the site is image-centric, I chose a photography based theme called Silvia, and I made a few adjustments to it:

I could have had the script automatically assign a featured image to each post, but I chose to make that decision manually. Here’s the end-result:

Let me know if you have any questions, and if you use the script, leave a link to the site you used it on in the comments below!

Standard
API, Del.icio.us, Ma.gnolia, Mahalo, Mahalo Follow, Twitter

Mahalo Follow 3.0

We just rolled out Mahalo Follow 3.0, and the big new feature this time around is the ability to cross-post any links you recommend to Mahalo via the Follow toolbar between Twitter, del.icio.us, and Ma.gnolia. Just add your account info (process shown below), and after recommending a link for a Mahalo search term, your link will be auto-posted to whichever services you set up via the service’s API.

Follow 3.0’s Preferences Dialog

Notice that you can choose which services to cross-post to each time you recommend a link.

Example of Follow 3.0’s new feature

Follow 3.0 is compatible with Firefox 1.5 through 3.0 Beta 2 and Flock 1.0.*, and you can install it at the Mahalo Follow homepage.

Standard