Working with LinkedIn in XPages

I will add some more examples to work with the LinkedIn API in the next release of LinkedIn controls.

Here is an simple custom control example to work with user’s connections:

<?xml version=”1.0″ encoding=”UTF-8″?>
<xp:view xmlns:xp=”http://www.ibm.com/xsp/core&#8221;
dojoParseOnLoad=”true”>
<head>
<xp:scriptBlock id=”scriptBlock1″>
<xp:this.value><![CDATA[function loadData() {
IN.API.Connections("me")
.fields(["pictureUrl","publicProfileUrl"])
.params({“count”:30})
.result(function(result) {
profHTML = “”;
for (var index in result.values) {
profile = result.values[index]
if (profile.pictureUrl) {
profHTML += “<a href=\”” + profile.publicProfileUrl + “\”>”;
profHTML += “<img height=30 align=\’left\’ src=\’” + profile.pictureUrl + “\’></a>”;
}
}
dojo.byId(“connections”).innerHTML = profHTML;
});
}]]></xp:this.value>
</xp:scriptBlock>
</head>
<body>
<div id=”connections”></div>
<script type=”IN/Login” data-onAuth=”loadData”></script>
</body>
</xp:view>

(don’t forget to include your API domain key)

As result you would get:

 

About these ads

Born in Holland, current country of residence is Sweden. IBM Notes Consultant since 1997. Main focus is Xpages development. Other interests: computers, motorcycles, music (bass guitar) & cooking.

Tagged with:
Posted in XPages

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Introduction
I am Patrick Kwinten. I am a IBM Notes Domino Product Specialist since 1996. With this blog I am trying to give my contribution to the community.
.
OpenNTF
Follow my projects on OpenNTF. Below are some examples:

Categories
RSS Feed
Follow

Get every new post delivered to your Inbox.

Join 201 other followers

%d bloggers like this: