Facebook 图表“用户/家庭” feed 现在包含难以识别的帖子项目活动

发布于 2024-12-02 17:07:23 字数 1289 浏览 2 评论 0原文

当我进行 Graph 调用 https://graph.facebook.com/me/home 时,我会在提要中返回一组分页帖子。最近,我开始收到似乎代表“John Doe 喜欢某个页面”之类的项目。它们被标记为链接,但如果我向 FB 索要该商品,我会收到一条状态帖子。这是一个删除了个人数据的示例:

{
application =             {
    id = 2530096808;
    name = Pages;
};
comments =             {
    count = 0;
};
"created_time" = "2011-08-28T18:54:09+0000";
description = "some text";
from =             {
    id = xxxxxx;
    name = "John Doe";
};
icon = "https://s-static.ak.facebook.com/rsrc.php/v1/yN/r/xCxxxxxxQO.gif";
id = "xxxxxxx_xxxxxxxxx";
link = "http://www.facebook.com/pages/Ted.Smith/xxxxxxxx";
name = "(name of page)";
picture = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/276841_xxxxxxxxxx_xxxxx_q.jpg";
type = link;
"updated_time" = "2011-08-28T18:54:09+0000";
}

但是,如果我使用 id 请求此帖子,我会得到以下信息:

{
  "id": "xxxxx_xxxxx", 
  "from": {
    "name": "John Doe", 
    "id": "xxxxxxx"
  }, 
  "type": "status", 
  "created_time": "2011-08-28T18:54:09+0000", 
  "updated_time": "2011-08-28T18:54:09+0000", 
  "comments": {
    "count": 0
  }
}

在 FB 中查看,我看到一条帖子,上面写着“John likes(页面名称)”。

我怎样才能识别这些?为什么它首先显示为链接,然后显示为状态更新?是否有此“活动”信息的任何文档?还有其他例子来自“John Doe 和其他人更改了他们的个人资料图片”等等。我必须做一些非常愚蠢、脆弱的过滤代码来删除它们,直到我知道如何处理它们。

帮助表示赞赏。

When I make the Graph call https://graph.facebook.com/me/home , I get back a paged set of the posts on my feed. Recently, I've started to get items that appear to represent things like "John Doe liked a page". They are marked as a link, but if I ask FB for the item, I get back a status post. Here's an example, scrubbed of personal data:

{
application =             {
    id = 2530096808;
    name = Pages;
};
comments =             {
    count = 0;
};
"created_time" = "2011-08-28T18:54:09+0000";
description = "some text";
from =             {
    id = xxxxxx;
    name = "John Doe";
};
icon = "https://s-static.ak.facebook.com/rsrc.php/v1/yN/r/xCxxxxxxQO.gif";
id = "xxxxxxx_xxxxxxxxx";
link = "http://www.facebook.com/pages/Ted.Smith/xxxxxxxx";
name = "(name of page)";
picture = "https://fbcdn-profile-a.akamaihd.net/hprofile-ak-snc4/276841_xxxxxxxxxx_xxxxx_q.jpg";
type = link;
"updated_time" = "2011-08-28T18:54:09+0000";
}

However, if I ask for this post using the id, I get this:

{
  "id": "xxxxx_xxxxx", 
  "from": {
    "name": "John Doe", 
    "id": "xxxxxxx"
  }, 
  "type": "status", 
  "created_time": "2011-08-28T18:54:09+0000", 
  "updated_time": "2011-08-28T18:54:09+0000", 
  "comments": {
    "count": 0
  }
}

Looking in FB, I see a post that says "John likes (name of page)".

How can I identify these? Why does it first show up as a link then as a status update? Is there any documentation of this "activity" information? There are other examples that come from "John Doe and others changed their profile image" and so forth. I am having to do some very silly, fragile filtering code to remove these until I know how to deal with them.

Help appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

剑心龙吟 2024-12-09 17:07:24

实际上我有一篇文章问了同样的问题。自从我大约一周前发布以来,它已经得到了 0 条回复。

因此,根据我的研究和测试,以下是您问题的答案。

1) 您无法识别其中大部分消息。有一些进来,如果您查看数据,也许您会知道它们是什么,但您会注意到它们缺少正确显示此更新所需的一些数据。

2) 某些消息似乎确实作为状态或链接类型随机出现。最常见的是,这与用户与另一用户成为朋友或用户更新其个人资料图片有关。

3)据我所知,没有办法正确获取有关这些消息的信息。我几乎已经尝试了所有我能想到的方法来解决这个问题。您所能做的就是忽略不包含为报告类型填写的正确字段的消息。例如,如果您获得“状态”类型并且它不包含消息字段,那么它显然不是真正的状态消息和某种您可能无法正确显示的子类型,因此只需跳过它。在您决定无法显示数据之前,请确保您正在查看数据,正如我所说,尽管其中一些数据被报告为错误的类型,但确实为您提供了足够的信息来显示它们。

当帖子与您的用户不直接是朋友的人有关时,您也会获得无用的数据。

希望有帮助。

I actually have a post asking this exact same question. It has gotten 0 responses since I posted it almost a week ago.

So, from my research and testing, here are the answers to your questions.

1) You can not identify MOST of these messages. There are some that come in that if you look at the data will give you an idea perhaps what they are, but you will notice they are lacking some of the data you would need to properly display this update.

2) Certain message do seem to come in randomly as either a status or link type. Most commonly this is in relation to a user becoming friends with another user, or a user updating their profile picture.

3) From as far as I can tell there is no way to properly get the information about these messages. I have tried literally everything I can think of to figure it out. All you can do is Ignore messages that do not include the proper fields filled in for the reported type. For instance, if you get a 'status' type and it contains no message field, it is obviously not really a status message and some sort of sub-type that you probably can not properly display anyways, so just skip it. Just make sure you are viewing the data before you just decided that you cant display it though, as I said some of them despite being reported as the wrong type, do give you enough information to display them.

You will also get useless data when the post would have something to do with a person whom your user is not directly friends with as well.

Hope that helps.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文