Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Justin Lasher 2 posts 23 karma points
    Mar 16, 2015 @ 18:52
    Justin Lasher

    Facebook Fan Page

    Let me start by saying thank you for the package! 

    It was very easy to hookup to my profile but I need a clients fan page and pull posts in from that. Is this possible?


  • Justin Lasher 2 posts 23 karma points
    Mar 16, 2015 @ 20:27
    Justin Lasher

    I was able to figure it out. Here's my code, what do you think?

    @using Skybrud.Social.Facebook
    @using Skybrud.Social.Facebook.Objects
    @using Skybrud.Social.Facebook.Responses
    @using Skybrud.Social.Umbraco.Facebook.PropertyEditors.OAuth
    @inherits Umbraco.Web.Mvc.UmbracoViewPage
        // Get the OAuth information stored in the property
        FacebookOAuthData facebook = Model.GetPropertyValue("facebook") as FacebookOAuthData;
        // Check whether the OAuth data is valid
        if (facebook != null && facebook.IsValid)
            var service = facebook.GetService();
            var posts = service.Posts.GetPosts("clientFanPageAlias");
                @foreach(var item in posts.Body.Data.Where(p => p.Type.In("photo","video","link")).Take(5))
  • Anders Bjerner 476 posts 2885 karma points MVP 6x admin c-trib
    Mar 16, 2015 @ 23:56
    Anders Bjerner

    Hi Justin,

    I haven't tested your code, but it looks correctly. For pages you can simply specify the alias of the page - exactly as you have done ;)

Please Sign in or register to post replies

Write your reply to: