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”
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: