Working with LinkedIn in XPages – Presenting a User’s Network Stream

Here is another example for accessing LinkedIn’s API’s in XPages. This example contains code for a custom control that will present the users network stream:

<?xml version=”1.0″ encoding=”UTF-8″?>
<xp:view xmlns:xp=”;
<xp:styleSheet href=”/stream.css”></xp:styleSheet>
<xp:scriptBlock id=”scriptBlock1″>
<xp:this.value><![CDATA[function loadData() {
// we pass field selectors as a single parameter (array of strings)
.result(function(result) {
var streamHTML = “”;
for (var update in result.values) {
var thisupdate = result.values[update]

// Build each individual stream update item
person = thisupdate.updateContent.person
var thisHTML = “<div>”;

// Person’s picture, linked name, and status
thisHTML += “<div>” ;
thisHTML += “<img align=’left’ height=’50’ src='” + person.pictureUrl + “‘></a>”;
thisHTML += “<a href='” + person.publicProfileUrl + “‘>”;
thisHTML += “<span>” + person.firstName + ” ” + person.lastName + “</a></span>”;
thisHTML += “<p>” + person.currentShare.comment + “</p></div></div>”;

// Slap this onto the HTML we’re building
streamHTML += thisHTML;
dojo.byId(“stream”).innerHTML = streamHTML;
<div id=”stream”></div>
<script type=”IN/Login” data-onAuth=”loadData”></script>

Also here remember to include the LinkedIn domain API key. The result could like something as this:

Applying some oneUI classes could improve the presentation… 😕

4 thoughts on “Working with LinkedIn in XPages – Presenting a User’s Network Stream

  1. Tim Tripcony 2012-March-19 / 7:47 pm

    To what does IN.API refer? Is there a client-side JavaScript library you’re using that isn’t reflected in the example markup?

  2. Vince Schuurman 2012-March-21 / 1:29 pm

    Wasn’t there some stuff in the extlib or was that only for Facebook?

    • Patrick Kwinten 2012-April-10 / 10:18 pm

      I thought I heard it was taken away due to legal stuff. Or maybe not.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s