4

I'm making an application which connects to SharePoint 2013. I'm using CSOM to work with SharePoint. I want to display the newsfeed of site (Team Site) which the current user follows.

To get the newsfeed, I implement the following step:

  • First, I get user's following sites list from SocialFollowingManager.
  • Next, with the sites information, I get a site's newsfeed information.

When getting followed sites' list (first step above), I can get Blog sites as well as Team Sites. I want to get only Team Sites.

Is there a way to get only Team Site (Team Site Template)?

Ondrej Tucny
  • 27,626
  • 6
  • 70
  • 90
  • 1
    It sounds like you already have code - show us code so we know where your problem lies. – Dennis G Mar 19 '13 at 09:40
  • Code is follow as; ClientContext context = new ClientContext(_siteURL); SocialFollowingManager followingManager = new SocialFollowingManager(context); ClientResult followedSiteResult = followingManager.GetFollowed(SocialActorTypes.Sites); context.ExecuteQuery(); That's code, I can get follow sites. But I only get following TeamSite information. – Hidekazu Takahashi Mar 21 '13 at 04:06
  • 1
    @HidekazuTakahashi The code shall be posted as part of your question, not in a comment. – Ondrej Tucny Apr 02 '13 at 15:28

2 Answers2

0

Unfortunately, the Social API only gives you the list of sites. You'll have to manually filter from there to determine which sites to display. It's not ideal but it's a limitation in the API.

Corey Roth
  • 1,095
  • 2
  • 8
  • 11
0
ClientResult<SocialActor[]> socialActors = new SocialFollowingManager(clientContext).GetFollowed(SocialActorTypes.Sites | SocialActorTypes.ExcludeContentWithoutFeeds);

That will give you every site excluding those who does not have feeds, ie, TeamSites

Hope it helps!

Johann Pérez
  • 367
  • 1
  • 16