开发者

Facebook Graph API - updated_time is incorrect for a single post

开发者 https://www.devze.com 2023-04-11 11:46 出处:网络
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'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

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号