view linkedin group members on my site without login

6 posts / 0 new
Last post
Joined: 2011-09-19
Sep 21, 2011
view linkedin group members on my site without login

I wish to get 8 random group members with their pictures firstname / last name and display them on my site. without visitors require to login.

I realise the Group API still aint that huge. But I think it should be possible. now i get member information from the last few posts in that group. and still need authenication.
Could anyone give me a push in the right direction.
The group as current isn't public... but if that's required to change that's no problem

i have erased my api key and changed my group number in this code sample:

<div id="linkedIn">
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key: *****************
onLoad: onLinkedInLoad
authorize: true
</script>
<script>
function onLinkedInLoad() {
IN.Event.on(IN, "auth", onLinkedInAuth);
}

function onLinkedInAuth() {
//IN.API.Connections("me")
IN.API.Raw("/groups/12345/posts:(title,summary,creator)?order=recency")
//.fields("id", "firstName", "lastName", "industry", "picture-url")
.params({"start": 10, "count": 50}) // start begins at 0
.result(displayConnections)
.error(displayConnectionErrors);
}

function setConnections(connections) {
var profileDiv = document.getElementById("connections");

var start = connections._start + 1; // because humans count from 1, not 0.
var range = connections._start + connections._count;
connectionsDiv.innerHTML = "<p>Displaying " + start + "-" + range + " of " + connections._total + " connections.</p>";

var members = connections.values;
for (var member in members) {
profileDiv.innerHTML += "<p>" + members[member].firstName + " " + members[member].lastName
+ " works in the " + members[member].industry + " industry.</p>";
}
}

function dump(obj) {
var out = '';
for (var i in obj) {
out += i + ": " + obj[i] + "\n";
}

alert(out);

// or, if you wanted to avoid alerts...

var pre = document.createElement('pre');
pre.innerHTML = out;
document.body.appendChild(pre)
}

function displayConnections(connections) {
var connectionsDiv = document.getElementById("connections");

var members = connections.values; // The list of members you are connected to

for (var member in members) {
if (undefined != members[member].creator){
connectionsDiv.innerHTML += "<div class=\"profile\" style=\"height: 62px !important;\"><div class=\"photo\"><a href=\"#\"><img height=\"60px\" width=\"60px\" src=\""+ members[member].creator.pictureUrl + "\" alt=\"LinkedIn: "+ members[member].creator.firstName + " " + members[member].creator.lastName+"\"/></a></div><span>"+ members[member].creator.firstName + " " + members[member].creator.lastName+",</span> "+members[member].creator.headline+"<br /><a href=\"http://www.linkedin.com/profile/view?id="+members[member].creator.id+"\" target=\"_blank\"><img class=\"connect\" src=\"img/connect.png\" alt=\"Connect\" /></a></div>";
}
//dump(members[member].creator);
}
}

function displayConnectionErrors(error) { /* do nothing */ }

function displayProfilesErrors(error) {
profilesDiv = document.getElementById("profiles");
profilesDiv.innerHTML = "<p>Oops!</p>";
console.log(error);
}

function displayProfiles(profiles) {
var profilesDiv = document.getElementById("profiles");

var members = profiles.values;
for (var member in members) {
profilesDiv.innerHTML += "<div class=\"profile\"><div class=\"photo\"><a href=\"#\"><img src=\"img/linkedin_thumb.png\" alt=\"LinkedIn: "+ members[member].firstName + " " + members[member].lastName+"\"/></a></div><span>"+ members[member].firstName + " " + members[member].lastName+",</span>"+members[member].industry+"<br /><a href=\"#\"><img class=\"connect\" src=\"img/connect.png\" alt=\"Connect\" /></a></div>";
}
}

</script>
<script type="IN/Login"></script>
<div id="profiles"></div>
<div id="connections"></div>
</div>

Kirsten Hunter's picture
Joined: 2011-06-30
Sep 22, 2011

Our API is not designed to allow you to display information about members to non logged-in members, and it is against our terms of use to do so.

Joined: 2012-05-09
May 9, 2012

Hi Kirsten,

Even Public LinkedIn Info?
I can see http://www.linkedin.com/in/jakobheuser without being logged in.

So, I can only display any of this info on my site (through the api) to my site's visitors if they are logged in to LinkedIn?

Thanks,
Phil

Jeremy Johnstone's picture
Joined: 2011-04-17
May 9, 2012

Hi Phil,

Correct, you can only show profile info (even public profile info!) if a user is logged in. This is clearly spelled out in our TOS.

-Jeremy

Els Willems's picture
Joined: 2013-03-23
Mar 23, 2013

I have a question: I want visitors to my website to view my LinkedIn profile by clicking on a LinkedIn logo. How can I realize this?
Thanks for your help.

Els

Shikha A. Sehgal's picture
LinkedIn Employee
Joined: 2012-07-27
Mar 27, 2013

hey Els:

Check out our Member profile plugin for this.