shane glass

Safari Microformats Plugin

Friday, June 19th, 2009

Microformats are a great idea for embedding contact and event information into a website. With the SafariMicroformats plugin, you can easily extract this information and add it to your address book or calendar.

The latest version of Kasper Nauwelaerts’ SMF plugin works with Safari 4 on OS X Leopard, but I’ve tweaked the plugin to work on Safari 4 under OS X Snow Leopard. It requires some simple tweaking and running Safari 4 in 32-bit as opposed to 64-bit, but it works great.

Here’s how.

SafariMicroformats

EDIT On 11 Jul 2009, Apple released OS X Snow Leopard build 10A402a. This build has no adverse effect on the SafariMicroformats if you updated Info.plist to “6531.0,” even though Safari’s latest version on Snow Leopard is 6531.1. I supposed you could up the version number to whatever you want, though.

EDIT: On 26 Jun 2009, Apple released an update for OS X Snow Leopard, version 10A394. Several issues were addressed in this version, and an apparent upgrade to Safari 4 was added as well, taking Safari 4 to version 6531.0. To help SafariMicroformats continue operating under Snow Leopard, simply use this version number instead of the ’6530.15′ used in the instructions below.

I’ve recently become interested in the simple power behind microformats. (Follow on Twitter, too.) Simply put, microformats are comprised of semantic markup using existing HTML tags to embed metadata into websites. With a few lines of code, you can embed contact information, calendars, and geographic locations.

Why is this important? With microformats like hCards, you can use the embedded information to add contacts to your address book. With hCalendars, you can add information about upcoming events to your calendar. There are many simple uses for microformats.

One thing I’ve noticed the movement lacking is easy integration with web browsers. The microformats site offers tools such as the hCard Creator to make coding effortless, but how is one to get the info from sites? If there’s a simple, browser-integrated way, I’m ignorant of it.

Screenshot showing my microformat embedded sidebarThis is where Kasper Nauwelaerts’ SafariMicroformats [download link] comes in. SMF is a simple plugin that you use through SIMBL (Smart InputManager Bundle Loader), an application that lets you take advantage of InputManager to load arbitrary code into an application, most popularly with Safari.

Before I delve any deeper, let me make it known: Tinkering with InputManager, especially loading code from untrusted sources, can potentially cripple and kill your system. If the code is malevolent, it can easily take control of applications and cause a major headache.

SMF is officially for the latest version of Safari (5510, I believe) and OS X 10.5 Leopard only, but I’ve been able to get it working in the 10A380 build of OS X Snow Leopard. The installation is rather straight forward. After downloading SIMBL and SafariMicroformats, follow these instructions:

  1. Install SIMBL in ~/Library/InputManagers folder.
  2. Install SafariMicroformats.bundle to the SIMBL plugins folder: ~Library/Application Support/SIMBL/Plugins/.
  3. Open or re-start Safari 4.

If you’re on Leopard 10.5, you should be good to go. When you navigate to a site with microformats embedded, you’ll see the microformats logo in your address bar to the right of the refresh and RSS icons.

If you’re like me and are running OS X Snow Leopard 10A380 (the WWDC ’09 version), you need to tinker some.

  1. Navigate in finder to ~/Library/Application Support/SIMBL/Plugins.
  2. Right-click on ‘safarimicroformats.bundle’ and select ‘Show Package Contents.’
  3. Navigate to /Contents/.
  4. Open ‘Info.plist’ with the text editor of your choice. (I open mine with Coda.)
  5. On line 31, change the MaxBundleVersion string to ’6530.15.’

You’re almost done. Now go to your /Applications folder and find Safari. Right click on it and select ‘Get Info.’ Check ‘Open in 32-bit mode” and click the Info box. If Safari is open, you will need to restart.

With those steps, you should be good to go. Now when sites you visit have a microformat embedded, you’ll see the microformat icon in your address bar.

Toolbar with SMF icon

.

One Response to “Safari Microformats Plugin”

  1. Tantek Çelik

    Great work Shane, and thanks for updating the Safari Microformats plugin for Safari 4 and Snow Leopard!

    I’ve added links to this blog post, and the plugin home and download pages to the microformats wiki here:

    http://microformats.org/wiki/safari

Leave a Reply