Facebook的图形"用户/家庭"进料现在包含活动项目后,很难鉴别 [英] Facebook graph "user/home" feed now contains activities as post items that are difficult to identify

查看:113
本文介绍了Facebook的图形"用户/家庭"进料现在包含活动项目后,很难鉴别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我做图形呼叫 https://graph.facebook.com/me/home ,我得到一个分页集的帖子在我的饲料。最近,我开始变得出现重新present喜欢的东西李四喜欢上了一个页面的项目。他们被标记为纽带,但如果我问FB的项目,我找回状态后。下面是一个例子,擦洗个人资料:

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";
}

不过,如果我要求这个职位使用id,我得到这样的:

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
  }
}

展望FB,我看到一个帖子,说:约翰喜欢(页面名称)。

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

我怎样才能识别这些?为什么它首先显示为那么作为状态更新的链接?是否有这种活动信息的任何文件?有迹象表明,来自其他的例子李四等人改变了他们的个人资料图片等字样。我有做一些很无聊的,脆弱的过滤code,除去这些,直到我知道如何对付他们。

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.

帮助AP preciated。

Help appreciated.

推荐答案

我其实有一个帖子问这个完全一样的问题。它已经得到0回应,因为我贴吧,几乎一个星期前。

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)无法识别大多数这些消息。还有一些进来的,如果你看一下数据将会给你一个想法,也许它们是什么,但你会发现他们缺乏一些您需要正确显示此更新的数据。

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)某些消息似乎随机进来无论是作为地位或链接类型。最常见的,这是相对于用户成为朋友与另一用户,或更新他们的个人资料图片的用户。

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)从据我可以告诉有没有办法正确地获取有关这些消息的信息。我已经试过所有的一切我能想到的数字出来。所有你能做的就是忽略不包括适当的字段填写为报告类型消息。举例来说,如果你得到一个状态类型,它不包含任何消息字段,这显然不是一个真正的状态消息和某种子类型,你可能无法正常显示反正的,所以就跳过它。只要确保你正在查看的数据之前,你刚刚决定,你不能显示它虽然,因为我说的一些人尽管被报告为错误的类型,做给你足够的信息来显示它们。

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.

希望有所帮助。

这篇关于Facebook的图形"用户/家庭"进料现在包含活动项目后,很难鉴别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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