Fwd: portable contacts to vCard converter

8 views
Skip to first unread message

Chris Messina

unread,
Dec 18, 2008, 9:21:42 PM12/18/08
to diso-project
I wonder if Stephen has time to whip up a Portable Contacts demo plugin for exporting your XFN links with PoCo and then pushing them into vcards? Of course, grabbing avatars from various sources would also make this extremely hot.

Chris

---------- Forwarded message ----------
From: Joseph Smarr <jsm...@gmail.com>
Date: Thu, Dec 18, 2008 at 3:19 PM
Subject: portable contacts to vCard converter
To: PortableContacts <portable...@googlegroups.com>


Hi guys, I just released a PHP library (and a hosted version on Plaxo) that can take any Portable Contacts JSON output and dump it as a vCard. You can try it out at http://www.plaxo.com/pdata/vcardTest and see the code at http://code.google.com/p/portablecontacts/source/browse/code/php/VcardSerializer.php

This serves both a practical and symbolic purpose: practically speaking, it makes it easy to support legacy clients that expect vCard files (e.g. Outlook, Mac Address Book, etc.) by being a Portable Contacts Provider--just convert your output as a post-transform and bingo, all those tools can consume it. And since Portable Contacts allows some basic filtering operations, it's actually a pretty powerful combination, e.g. I can now easily download vCards with name and mailing address for all my "family connections" in Plaxo (just in time for writing holiday cards). :)

And symbolically, it shows just how compatible Portable Contacts and vCard are--the code is increddibly simple, and the mappings are all one-to-one, and this is shown concretely by looking at the code. In fact, when I realized that there weren't any high-quality vCard generator libraries for PHP, and I decided to write one myself, it occurred to me that any serialization code needs an "object representation" of the data as input, and what better object representation for vCard data than the parsed JSON from Portable Contacts! In other words, it's not just a format-converter, Portable Contacts *is* the logical object representation of vCard, and this code again demonstrates that nicely.

Check it out and let me know what you think. Among other things, we can now extend Kevin's famous hCard->vCard->PoCo "long pipe" even further:

Step 1: start with kevin's twitter followers as a vCard:
http://technorati.com/contacts/twitter.com/kevinmarks

Step 2: convert it from vCard to Portable Contacts (we built this previously):
http://www.plaxo.com/pdata/vcard?vcard=&vcardUrl=technorati.com%2Fcontacts%2Ftwitter.com%2Fkevinmarks&format=json&plaintext=1&pretty=1

Step 3: use that as input to re-generate the vCard and complete the cycle (this is new):
http://www.plaxo.com/pdata/pc2vcf?pcUrl=http%3A%2F%2Fwww.plaxo.com%2Fpdata%2Fvcard%3Fvcard%3D%26vcardUrl%3Dtechnorati.com%252Fcontacts%252Ftwitter.com%252Fkevinmarks%26format%3Djson

Step 4: use this as input and go to step 2; repeat until your brain hurts (or you hit the HTTP GET length-limit). :)

Thanks, js





--
Chris Messina
Citizen-Participant &
 Open Technology Advocate-at-Large
factoryjoe.com # diso-project.org
citizenagency.com # vidoop.com
This email is:   [ ] bloggable    [X] ask first   [ ] private

Stephen Paul Weber

unread,
Dec 21, 2008, 5:23:18 PM12/21/08
to diso-p...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Somebody claiming to be Chris Messina wrote:
> I wonder if Stephen has time to whip up a Portable Contacts demo plugin for
> exporting your XFN links with PoCo and then pushing them into vcards? Of
> course, grabbing avatars from various sources would also make this extremely
> hot.

What data would you expect to be exported? We have URL,
relationship (not applicable), implied name/nickname, and then we can
get more from their sites / other sources (if that's expected?).

- --
Stephen Paul Weber, @singpolyma
Please see <http://singpolyma.net> for how I prefer to be contacted.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFJTsHW6oSxepE9BOsRAiZMAJ4yL8Dy+l/nI+uDvgYq/ZisQfU9/gCfXm4g
GTrR0dzzROkVbU2hUeg5H/A=
=0ZgL
-----END PGP SIGNATURE-----

Chris Messina

unread,
Dec 21, 2008, 8:40:08 PM12/21/08
to diso-p...@googlegroups.com
So, let me put it this way.

I'd love to be able to turn my blog into MY PoCo provider (meaning adding an entry to my XRDS-Simple profile using the plugin)... I would want to be able to share my list of WP link-roll friends (and perhaps pick which ones to send based on a specific relationship type!) when a remote site requests them.

You could pull information from other sources, but for now I'd rather just see what it's like based on the data already stored.

Chris
--
Chris Messina
Citizen-Participant &
 Open Web Advocate-at-Large

Vote in the OpenID Board Election!
http://tr.im/vote_oidf
Reply all
Reply to author
Forward
0 new messages