如何通过Facebook Graph Api获取用户的朋友在他生日那天发布在用户墙上的帖子? [英] How to get posts that user's friend posted on the wall of user on his birthday through Facebook Graph Api?

查看:38
本文介绍了如何通过Facebook Graph Api获取用户的朋友在他生日那天发布在用户墙上的帖子?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试构建一个 Chrome 扩展程序,我想获取人们专门在用户生日那天发布在用户墙上的所有帖子.

I am trying to build a Chrome extension and I want to get all the posts that people posted on the user's wall specifically on his birthday.

我尝试通过 Facebook Javascript SDK 调用,但它没有返回我朋友在生日那天发布的帖子.

I tried to call through Facebook Javascript SDK, but it is not returning the posts that are posted by my friends on the birthday.

FB.api(
  '/me/feed',
  'GET',
  {},
  function(response) {
      // Insert your code here
  }
);

相反,它在一个帖子中返回所有生日帖子,如下所示:

Rather, it is returning all the birthday posts in one post like this:

{
      "message": "Belated happy birthday bhaiii.....",
      "created_time": "2015-10-19T00:02:02+0000",
      "id": "578828115566706_848912165224965"
    },
    {
      "story": "Ritwik Jain and 40 others wrote on your Timeline.",
      "created_time": "2015-10-18T03:59:39+0000",
      "id": "578828115566706_848604468589068"
    },

如何单独获取每个帖子?

How do I get each post individually?

提前致谢.

推荐答案

正如您所发现的,/me/feed 端点是您需要使用的 - 与 user_posts权限,当然.Facebook 将生日帖子放在一起,但没有其他方法可以获取这些帖子.意思是,无法单独获取生日帖子.

As you found out, the /me/feed endpoint is what you need to use - with the user_posts permission, of course. Facebook puts birthday posts together as it seems, but there is no other way to get the posts. Meaning, there is no way to get the birthday posts separately.

用户墙的端点:https://developer.facebook.com/docs/graph-api/reference/v2.5/user/feed

这篇关于如何通过Facebook Graph Api获取用户的朋友在他生日那天发布在用户墙上的帖子?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆