Dispaying Feeds from a single Group page

14 posts / 0 new
Last post
Jonathan Yablonski's picture
Joined: 09/14/2011
Thu, 09/15/2011 - 08:39
Dispaying Feeds from a single Group page

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

Jeremy Johnstone's picture
Developer Advocate
Joined: 04/17/2011
Fri, 09/16/2011 - 15:35

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

Jonathan Yablonski's picture
Joined: 09/14/2011
- (Reply to #2) Fri, 09/16/2011 - 15:53

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

Jeremy Johnstone's picture
Developer Advocate
Joined: 04/17/2011
- (Reply to #3) Fri, 09/16/2011 - 16:48

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

Jonathan Yablonski's picture
Joined: 09/14/2011
Mon, 09/19/2011 - 14:32

Is there a good resource that helps newbie's like me know how to properly implement the calls for Group post? The link you provided is much appreciated, but I'm not positive where exactly this would used.

Thanks again Jeremy!
- j

Jeremy Johnstone's picture
Developer Advocate
Joined: 04/17/2011
Mon, 09/19/2011 - 16:51

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

Jonathan Yablonski's picture
Joined: 09/14/2011
Tue, 09/20/2011 - 13:20

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

Jonathan Yablonski's picture
Joined: 09/14/2011
Tue, 09/27/2011 - 11:39

Any ideas on this one Jeremy? I'm a bit lost as to where /groups/{group-id}/posts comes into play.
Thanks,
_ j

Kirsten Jones's picture
Joined: 06/30/2011
Tue, 09/27/2011 - 14:01

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>
Jonathan Yablonski's picture
Joined: 09/14/2011
Fri, 09/30/2011 - 12:56

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

Jeremy Johnstone's picture
Developer Advocate
Joined: 04/17/2011
Mon, 10/03/2011 - 16:57

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

Jonathan Yablonski's picture
Joined: 09/14/2011
Thu, 10/06/2011 - 13:44

Thanks Jeremy.

Simon Crompton-Reid's picture
Joined: 09/27/2011
Wed, 02/22/2012 - 04:16

Hi Jeremy
i am looking to attach links for each post but i dont get this in attachment object with a RAW API call.
Any idea why?
Thanks

Kirsten Jones's picture
Joined: 06/30/2011
Wed, 02/22/2012 - 09:18

Simon,

You need to provide the calls you're making (or trying to make), what you expect to happen, and what's happening instead.