LinkedIn Profile API - Unofficial and 100% Open Source

Presenting the open source PHP LinkedIn Public Profile API, released under the GNU

How does it work?
This PHP Class (requires php5) imports a users LinkedIn public profile (by supplying their public profile username) and turns the results in to a simple XML document.

You can see my example at http://brandonshead.com/work/linkedinProfile/profile.php

How do you use it?
First you have to download the linkedin open source API here.
Inside you will find 3 files.
1. linkedin.php - the actual PHP Class (requires PHP5)
2. profile.php - an example of how to use the Class.
3. livingresume.xsl - the default XSL that is attached to the Users XML Profile.

Usage:

<?
include_once('linkedin.php');
$LIProfile=new linkedinprofile(’brandoncorbin’);
// OUTPUT THE RESULTS
header(”Content-Type:application/xml”);
echo $LIProfile->getProfileXML()->asXML();
?>

Questions? Leave them in the Comments and I will reply ASAP.

Disclaimer: I offer absolutely no guarantees that this will work on your system. As a matter of fact, it’s possible that this script could ask you to play “global thermal nuclear war” - if it does, please answer no. We all know what about happened last time.

5 Responses to “LinkedIn Profile API - Unofficial and 100% Open Source”

  1. portjump  on March 3rd, 2009

    Hey Brandon -
    Fantastic idea! I’ve really been getting into using social media as a marketing tool and started doing my homepage updates with a twitter feed. Came across your page looking for a way to do the same thing with my LinkedIn public profile.

    Noticed your example doesn’t work, and I’m just wondering if that was due to LinkedIn shutting it down or something else…

    I’m trying to do this script in ASP, so I was going to use this as a basis. If I manage to pull it off, I’d be happy to share for you to re-post.

    -Pete

  2. brandon.corbin  on March 3rd, 2009

    Pete, by now, I am sure that linkedin is rejecting requests from the html2xml service that I was using - but finding another service would remedy the problem :) - And I would absolutely love to hear if you end up porting it over to asp, that would be pretty cool.

  3. portjump  on March 17th, 2009

    I did see something on their blog that they decided to make their own widget to be able to allow you to include it on your website, but it’s still not as flexible as what you were doing. It’s really to bad they stifled your development rather than embracing it.

  4. Eric  on June 16th, 2009

    Hey Brandon,

    Your code seems to work fine. Great. I have just one problem (and i’m not a php expert..). Its just loads one job, education etc. The loop is working fine ($experience) and has got the right content (more jobs), but its doesn’t save it in the job array ($this->profilexml->jobs->job[$i]->..) Any idea?

  5. brandon.corbin  on June 17th, 2009

    Hey Eric, it might be that they modified their Jobs list basic HTML which could make the parser no longer find it… If they have changed it, then the change will need to be reflected in the Xpath call… Does that help?


Leave a Reply