A Few Things I Learned About the vCard Spec Tonight

Today I spent some time coding my most complicated hCard (yeah, I know—it’s not supposed to be hard). Well, I wanted to create an hCard that had EVERYTHING in it—this hCard needed multiple locations, which I haven’t done. So, enter the “type” parameters of the hCard.

Actually, it goes back a bit further. hCard is essentially just an XHTML markup version of the vCard format, so I spent some time reading the vCard spec so I could understand it better.

So, I’m trying to code this hCard so I can run it through Operator or the hCard parser on Technorati and then pull that vCard into Address Book. So, I code it, but I notice that I’m having issues with the mobile phone number, websites, and email addresses. Mobile was importing as “Other”, websites were all importing simply as “home page” (not part of the spec), and all email addresses were importing as “work”. This was frustrating because I could then edit them in Address Book to be home, work, mobile, whatever. But I wanted it to happen automatically when converted.

So, after digging deeper, I am happy (or maybe not) to report these tidbits I found out about the vCard format:

  1. It’s not “mobile”, it’s “cell”. This was the easiest fix. Just change “mobile” to “cell”. Blizam. Fixed.
  2. There is no “type” for web pages. You can’t denote in a vCard that at web page is someone’s personal site or their work site. Kind of a bummer. Would be nice to be able to list batchblue.com as my work web site and then a few as personal ones, like this one, my Flickr, the TWML maybe. I don’t want those mixed up with work accounts. However, no way to do it—with keeping with the standard. I guess in development, we’ll allow them to set those types in the application, but when the data is exported it will have to revert to the type-less general web page.
  3. There is a type for email, but it’s useless. So, email does have a type. But they are INTERNET, x400, pref, and “other IANA registered address types”. Wowee, internet. That helps. So, there’s no work or home, so it’s no good to me. The “pref” means “preferred”, so that could be of some use. But I’m planning to have a primary contact set on the work/home level, not for each individual contact means.

So there you have it. A few things I ran into that you may at some point.

Comments are closed.