Change from FQL to Graph API

可紊 提交于 2019-12-13 08:25:54

问题


So I understand that FQL is going to be deprecated soon in favor of the graph API, I read about some graph API examples but yet to find how to do what I actually need. So the thing is simple, I need to select from a page all its albums that are updated in the last 2 weeks, and from the photos inside these albums all photos that have been updated in the last 2 weeks. In FQL it would go something like this (2 queries):

SELECT aid, object_id, name, description FROM album WHERE owner=' . $owner . ' AND modified>' . $time . ' ORDER BY modified DESC;
SELECT pid, object_id, src_small, src_big, caption, modified FROM photo WHERE album_object_id=' . $query1['object_id'] . ' AND modified>' . $time . ' AND owner=' . $owner . ' ORDER BY modified DESC;

I also heard this can be combined with the graph API, if thats really possible I would like to know it too. Thanks for the helpers.


回答1:


Currently it's not possible to apply a manual ordering in the Graph API. There are the since and until parameters, but they refer to the created timestamp, and not the updated timestamp IMHO. See

  • https://developers.facebook.com/docs/graph-api/using-graph-api/v2.2#paging

In general, FQL is usable until August 7th, 2016. So if this is a important use case for you, I'd recommend to stick with FQL and wait until the Graph API (maybe) gets augmented with this functionality.



来源:https://stackoverflow.com/questions/27519559/change-from-fql-to-graph-api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!