JavaScript
Article
By Sam Deering

jQuery Display LinkedIn Connections

By Sam Deering

This is how you can quickly load your LinkedIn connections into nice thumbnail links using some jQuery and the LinkedIn API. Check out the demo below. Note: You’ll also need to include your API key from LinkedIn which you can get from the LinkedIn Developer Network.

linkedin-connections2

Demo

Sign in with LinkedIn to load your connections.

LinkedIn Connections

--ADVERTISEMENT--

jQuery

function loadLinkedInData()
{
    //element cache
    var connectionsElem = jQuery("#connections"),
        loadingElem = connectionsElem.find('.loading');

    //show loading image
    loadingElem.show();

    //load in linkedin connections
    IN.API.Connections("me")
    .fields(["pictureUrl","publicProfileUrl"]) //fields to load in
    .params({"count":30}) //number of thumbs to display
    .result(function(result)
    {
        //process the results for each connection create html
        var profHTML = "

"; jQuery.each(result.values, function(i,v) { if (v.pictureUrl) { profHTML += ""; profHTML += ""; } }); profHTML += '

'; //display the connections html jQuery("#connections").html(profHTML); }); }

HTML

LinkedIn Connections

Recommended
Sponsors
The most important and interesting stories in tech. Straight to your inbox, daily. Get Versioning.
Login or Create Account to Comment
Login Create Account