A start towards Net::OpenID::UserProfile

Martin Atkins mart at degeneration.co.uk
Wed May 25 12:02:21 PDT 2005

Attached are some Perl modules which implement the lowest level of 
getting user profile data: actually grovelling around inside the 
referenced documents and making a nice, uniform data structure out of it.

They're by no means complete or finished, but they're a start. I wasn't 
really sure where to put them in the package heirarchy, so for now 
they're just stuck at the top-level.

I imagine a nicer interface atop this which takes a bunch of different 
URLs and calls the right modules to get the data. It then returns a 
blessed reference with some accessor methods.

There are two different ways sites are likely to want this to work:
* Try each URL in some preference order and take the result of whichever 
one works first. This makes the minimum number of requests necessary.
* Try each URL in some preference order, copying the results from each 
into another hash where they weren't defined before, thus allowing later 
results to supplement previous ones. In this case, all of the URLs will 
be requested.

To facilitate this, the modules make some attempt to distinguish between 
failure and lack of data, with the assumption that in the first use case 
you will want to continue until one succeeds, even if that one contains 
no data. The modules will return undef on failure (couldn't fetch, 
couldn't parse) and an empty hashref if the document was retrieved but 
there was nothing suitable inside.

(Having said that, with how it's currently implemented many cases cause 
it to return a hashref containing a bunch of keys all pointing at undef.)

I've left out vCard for now because the avilable Perl modules for  it 
are a bitch, and it appears that there are a few different versions of 
it including an XML serialization. Someone needs to do some research to 
see what kinds of vCard files people are publishing online. I suspect 
the biggest exporter of these is competing identity system LID, which 
uses XML vCard. Supporting XML vCard, then, would be useful when it 
comes time to make a dual-headed OpenID+LID ID server or an OpenID to 
LID proxy.

Hopefully these will prove useful as a starting point for 

More information about the yadis mailing list