Eduardo Ortega Padilla Eduardo Ortega Padilla -4 years ago 151
C# Question

Get more facebook comments using Skybrud

I'm developing an app which connects to a specific public page on facebook and search for the comments in a specific post, we have to look all the posts in order to find specific hashtags but there's one post with 4000+ comments, facebook throws this exception:

'StackTrace: Skybrud.Social.Facebook.Exceptions.FacebookException: Please reduce the amount of data you're asking for, then retry your request
at Skybrud.Social.Facebook.Responses.FacebookResponse.ValidateResponse(SocialHttpResponse response, JsonObject obj)
at Skybrud.Social.Facebook.Responses.Comments.FacebookCommentsResponse.ParseResponse(SocialHttpResponse response)
at Skybrud.Social.Facebook.Endpoints.FacebookCommentsEndpoint.GetComments(String id, FacebookCommentsOptions options)'

As you can see I'm using Skybrud, I limited the comments to 800 and it works, but there are more comments and I don't know how to retrieve the other pages of comments, any ideas?.

Thanks for your time.

Answer Source

Maybe this could help someone else, use the two members from the FacebookCommentsOptions: Before and After, the response from Facebook will include this in the Paging section. Then call again the GetCommets method.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download