Is there a way I could possibly have just the feeds from one particular group page show up? I am trying to achieve this on this site: http://pashhra.org/dev_a/
Thanks!
- j
- Log in to post comments
Is there a way I could possibly have just the feeds from one particular group page show up? I am trying to achieve this on this site: http://pashhra.org/dev_a/
Thanks!
- j
Thanks for the reply Jeremy,
Where this should be happening is in the sidebar under "Latest News", and what is currently happening is there is a LinkedIn button that prompts to a login screen, and upon successful login the feed show become visible. Not sure why it would not be showing up at all (perhaps a browser inconsistency?) I am on Firefox, and have tested in Safari and Chrome— all w/ success.
What I am trying to achieve is displaying a particular group feed instead of my personal feed: I assume this is possible? Also, is there a way I can display the group feed w/o users needing to login to LinkedIn?
Thanks!
- j
Hi Jonathan,
Yes, I do see a signin button, but nothing indicated to me that signing in would show groups below ("Latest News" didn't immediately make me think "LinkedIn Group", but I could see the connection now that you mention it). If you looked at the docs I linked to previously, you would find there is an API call to retrieve a group's discussion posts. A more direct link is here:
https://developer.linkedin.com/documents/groups-api#groupposts
-Jeremy
There currently isn't a tutorial / guide on the groups API. This is something we hope to address in the future. If you would like to try your best to follow along with the docs as written, I am happy to help any time you get stuck on a specific part (even if that means you get stuck a fair bit initially).
-Jeremy
Thanks Jeremy, that awesome. Ok, so to begin, here is what I am currently using to pull updates from my personal page:
IN.API.NetworkUpdates()
.params({type:"SHAR","count":"3"})
.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 class=streamitem>";
// Person's picture, linked name, and status
thisHTML += "<div class=updateperson>" ;
thisHTML += "<img class=img_border align=\"left\" height=\"50\" src=\"" + person.pictureUrl + "\"></a>";
thisHTML += "<a href=\"" + person.publicProfileUrl + "\">";
thisHTML += "<span class=updater>" + person.firstName + " " + person.lastName + "</a></span>";
thisHTML += "<p class=update>" + person.currentShare.comment + "</p></div></div>";
// Slap this onto the HTML we're building
streamHTML += thisHTML;
}
$("#stream").html(streamHTML);
});
}
And as I understand it, I use the following the obtain post from a specific page: /groups/{group-id}/posts
My question is:
Where does this code come into play in relation to what is above, and how exactly do I find the group id?
Thanks again Jeremy,
- j
You need to use a Raw call to make this work (as there is no built in Groups call for the Javascript API yet):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
<html>
<head>
<title>Connections App Example</title>
<script type="text/javascript" src="http://platform.linkedin.com/in.js">
api_key: o1yf9WMdgd8dp_OGkmtXESCOJFostN8N1jI1AFKY2i0kJ1QFNMOs3a6R5qUoBIqF
authorize: true
</script>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" src="http://code.jquery.com/jquery-1.5b1.js"></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.7/jquery-ui.min.js"></script>
<script type="text/javascript">
function loadData() {
IN.API.Raw("/groups/123456/posts")
.result(function(result) {
alert(JSON.stringify(result))
})
}
</script>
</head>
<body class="yui3-skin-sam yui-skin-sam">
<script type="IN/Login" data-onAuth="loadData"></script>
</body>
</html> |
Thanks Kirsten! I applied the code you provided, and I can see that it is grabbing the post from the specified page. My only question now is how to format this post info and have it show up in the sidebar (as of right now it is showing up in a pop up box as non-formatted info).
- j
Hi Jonathan,
Kirsten wrote a series of excellent tutorials on the Javascript API. One in particular which is similar, but not the same as what you are doing is here:
http://developer.linkedinlabs.com/tutorials/jsapi_netstream/
Reading over it, hopefully it should make sense what is needed to put the content into the page as you are wanting. Take a look at it and see if it makes sense and feel free to ask questions as needed.
-Jeremy
I don't see anything on that site which you link to to give me indication of what you are trying to achieve. As far as showing information from a particular group, we have a groups API which is documented extensively here:
https://developer.linkedin.com/documents/groups-api
-Jeremy