Search This Blog

Monday, December 13, 2010

Facebook Graph API: Getting the total number of posts

Programmer Question

I've been using the Facebook Graph API to display user posts. When I get the initial "page" of posts, the resulting data object has a paging property object with a previous and next URL property. I was hoping to generate navigation links based on this available paging information. However, sometimes these URLs point to an empty set of data, so I obviously don't want to navigate the user to an empty page.



Is there a way to find the total count of objects in a collection so that better navigation can be derived? Is there any way to get smarter paging data?



Update:
Sorry if my post isn't clear. To illustrate, look at the data at https://graph.facebook.com/7901103/posts and its paging property URLs. Then follow those URLs to see the issue: empty pages of data.



Find the answer here

No comments:

Post a Comment

Related Posts with Thumbnails