按时间过滤用户上传的照片,Facebook图表api v2.2

时间:2015-03-13 14:42:06

标签: facebook facebook-graph-api facebook-graph-api-v2.2

在我的应用程序中,我正在从Facebook上传用户上传的照片。我也想按时间过滤结果。我是使用FQL multiquery实现的:

 //FQL multiquery

 [query_uploaded_photos] => select  object_id, album_object_id, owner, caption, place_id, created, comment_info.comment_count, like_info.like_count  from photo where owner in (me()) AND (( created >=  1425031156 AND created <= 1426149034 ))  limit 50

 [ppl_tagged_in_uploaded_photos] => select object_id, subject from photo_tag where object_id in  (select object_id from #query_uploaded_photos)

我正在将代码迁移到图形api v2.2。对于上述请求,我实施了以下实施:

 //Graph request

 me/photos/uploaded?album{id},id,from{id},name,created_time,place{id},comments{comment_count},likes,tags{id}

它为我提供了所有标记,例如上传照片的评论数据,我尝试在上面的图形请求中为时间添加过滤器。

 //Graph request with time filter

 me/photos?fields=uploaded.since(1425031156){album{id},id,from{id},name,created_time,place{id},comments{comment_count},likes,tags{id}}

通过添加过滤器,它不会给我喜欢,评论,标记数据。

我如何得到结果与我通过FQL实现的结果相似。

感谢。

1 个答案:

答案 0 :(得分:0)

试试这个:

me/photos?fields=album{id},id,from{id},name,created_time,place{id},comments{comment_count},likes,tags{id}&since=1425031156&type=uploaded

注意:我将来自字段列表的uploaded.since(#)移动到查询字符串末尾的两个单独的参数:since =#and type = uploaded