Copied to clipboard

Flag this post as spam?

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


  • Morten B 13 posts 66 karma points
    Oct 27, 2015 @ 14:08
    Morten B
    0

    Facebook posts are missing picture information

    I am trying to fetch posts (with pictures) from a Facebook Page. For starters I used this example; http://social.skybrud.dk/facebook/authentication/app-access-token/ - Text and datetime is fetched, but the "picture" string is empty.

    Then I tried something in the lines of this hoping to get (more) raw data, but still no picture information - looks like a raw version of the above?

    var options = new Skybrud.Social.Facebook.Options.Posts.FacebookPostsOptions(); options.Limit = 3; var response = service.Posts.Raw.GetPosts("517606015033481", options);

    The output format doesn't really matter. JSON or strongly typed objects - I just need to be able to get an array or list with the pictures in the Facebook posts.

    Right now it is kind of trial and error. Can anyone give me a hint in the right direction? Feels like I am missing an option somewhere.

  • Anders Bjerner 457 posts 2693 karma points MVP 5x admin c-trib
    Oct 27, 2015 @ 14:12
    Anders Bjerner
    100

    Hi Morten,

    For recent versions of the Facebook API, only a few fields are returned by default, so you need to specify them explicitly. You can read more about that here: http://social.skybrud.dk/facebook/fields/

    Here is a quick example for getting posts:

    FacebookGetPostsOptions options = new FacebookGetPostsOptions("umbraco") {
        Fields = "id,message,picture"
    };
    
    foreach (FacebookPost post in facebook.Posts.GetPosts(options).Body.Data) {
    
        <p>@post.Id (@post.Picture)</p>
    
    }
    

    You can find a list of all supported fields in the Facebook documentation: https://developers.facebook.com/docs/graph-api/reference/v2.5/post#fields

  • Morten B 13 posts 66 karma points
    Oct 27, 2015 @ 14:44
    Morten B
    0

    Thank you. Upgrading the DLL to the latest release also helped :-)

Please Sign in or register to post replies

Write your reply to:

Draft