Tag Archives: wordpress

FOAF hacks of the day

A bit of hacking tonight, after a lot of interesting talks this afternoon about FOAF, OpenID and online identity (and certainly more to come tomorrow):

  • Added queries to retrieve user accounts from FOAF profile and display them in comments with SparqlPress. Once again, it’s done by SPARQLing the FOAF URI of the user logged-in on this blog using an OpenID URL. To be displayed, the account must either have a URI (i.e. not to be a blank node) or a foaf:accountProfilePage (BTW, this one is not in the specs while it seems most people agreed on it – and already use it. Dan, what about it ?). Also added icons for some well-knows services. Live example here, and screenshot:


  • Updated the simple network browser script to be compliant with the new release of a GraphGear (1.2). The component has new interesting features that can be set in the xml file, as setting the size of the nodes, and adding images. I updated the script to benefit from those features, and so it now display pictures and smaller nodes, which make the script run faster. The image detection only handles foaf:img at the moment, so this is something that whould need more work (e.g. retrieve sioc:avatar from the related online account …). Yet, here’s a sreenshot of the new rendering that you can browse there:


Time to sleep now …

About these ads

WordPress, FOAF, OpenID – updated

Here’s an update of my previous experiments on retrieving FOAF profiles when users authenticate a wordpress blog with OpenID.

The openid plug-in for WordPress is now stable (I made the experiments on svn versions), so here’s the piece of code that retrieves profiles when creating user account – tested with v2.1.2 of wp-openid.

Unpack the tgz in your the wp-openid folder, and check readme-foaf.txt for instructions. This version also features a function you can add in your templates to show the FOAF icon and a link to the profile in comments, and a way to cron the autodiscovery feature for profiles updates (Edit: The cron now tries to find FOAF files from user homepages, see comments).

I’ll maintain this hack for next updates of wp-openid (unless it’s in the plug-in itself). Nexts steps will be to retrieve people URI (more than just the profile, which should be easy if people use the foaf:openid property in their profile) and use these data in the SIOC and FOAF exports for WordPress. It will be one more way to provide a RDF-ized social graph, with reference to existing profiles and URIs.