简体   繁体   中英

Facebook Graph API - updated_time is incorrect for a single post

I've built a timeline app, using the graph API to query the posts on a specific facebook page. I use the updated_time of the post to arrange it in order on the timeline.

I got a bug report filed today, because a single post keeps moving to the front of the timeline.

It looks like whenever someone comments on this post, the updated_time is changed. Weirdly, this only seems to be the case for this one wall post. All of the others have their created_time the same as the updated_time as I'd expect. Posted comments on these posts will not "bounce" them to the front of the timeline.

I call the graph API like this: https://graph.facebook.com/somepagename/posts?method=GET&metadata=true&format=json&access_token=XXXXXXX

In the JSON, I get some post items looking like this:

{
 ...
   "created_time": "2011-10-05T11:47:20+0000",
   "updated_time": "2011-10-05T11:47:20+0000",
 ...
},
{
 ...
   "created_time": "2011-10-05T08:12:27+0000",
   "updated_time": "2011-10-05T11:57:35+0000", <--- PROBLEM!
 ...
},
{
 ...
   "created_time": "2011-10-04T12:52:39+0000",
   "updated_time": "2011-10-04T12:52:39+0000",
 ...
},

Is this a bug in the Graph API, or is there something else going on that I don't understand? Is the updated_time calculation different for different types of wall posts (gallery updates, video posts, text, etc)?

The correct behavior is for updated_time to change each time a comment is added to a post.

However, there is currently a bug in which updated_time gets reset to the value of created_time when the post gets a certain number of comments (seems to be around 30). In your case, it sounds like the other posts probably already have a large number of comments.

This bug has been around for a long time but I'm optimistic that we'll finally see a resolution in the near future thanks to "Operation Developer Love". You can view the bug report and subscribe to updates here: http://developers.facebook.com/bugs/274107099276048

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM