重新共享状态信息 [英] Information of re-shared status

查看:158
本文介绍了重新共享状态信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在与Facebook图表api工作几天。我试图提取用户的状态和转发的信息,如果有的话。我可以使用 fields = id,name,statuses 查询轻松查找用户的状态。但是,我找不到有关重新分享的任何信息。我找到一个状态为 sharedposts 的字段。但不明白它实际上是什么。任何人都可以启发我如何收集有关转发的信息(转贴,转贴,转贴位置)。我使用了user_status访问令牌。

解决方案

sharedposts 字段适用于状态ID。例如,状态ID 10151794781777494 来自已经共享4次的TheMrazyCouponLady 的状态更新。这个查询:

  / 10151794781777494?fields = sharedposts 

将返回有关共享它的用户的所有信息。如果要将返回的字段限制为共享者的名称和ID,以及共享的时间和位置,可以执行以下操作:

  /10151794781777494?fields=sharedposts.fields(from,created_time,place)

尽管我希望大部分时间不会有任何位置数据。



首先要查找状态ID,您只需查询状态字段。再次,以 The KrazyCouponLady (uid 255919387493)为例:

  / 255919387493?fields = statuses 

只得到ids:

  /255919387493?fields=statuses.fields(id)

替代的是,您可能需要考虑查询用户的帖子。使用帖子的优点是您可以获取该查询中每个帖子的共享数。

  /255919387493?fields=posts.fields(id,shares)

如果共享计数一个帖子是零,那么显然没有必要运行另一个查询来检索已经共享该帖子的用户。



使用帖子的缺点是发布ID与状态id略有不同。您会看到如下所示的ID:

  255919387493_10151794781777494 

该字符串的前半部分是帖子所有者的用户标识。下半部分是实际状态ID。如果要查询该帖子的 sharedposts 字段,您首先必须提取下半部分(状态ID)并将其用于查询。


$ b $那么说到这里,如果你把 status 查询和 shareposts 查询链接在一起,你可以一次性检索所需的所有信息。例如,这样的东西:

  /255919387493?fields=statuses.fields(id,message,sharedposts.fields(from, created_time,place))

将从该用户返回每个状态的状态ID和消息文本,和用户详细信息,为共享每个这些状态的每个人创建时间和位置。



即使有分页,这可能是一个相当缓慢的查询,所以我不知道这是个好主意。值得考虑。


I am working with Facebook graph api for few days. I am trying to extract user's status and the information of reshared if any. I can easily find status of a user using fields=id,name,statuses query. But I could not find any information about re-sharing. I found a field of status sharedposts. But could not understand what it actually does. Can anyone enlighten me about how can I collect information about resharing (who reshared,when reshared,resharing location). I used user_status access token.

解决方案

The sharedposts field applies to a status id. For example, the status id 10151794781777494 is from a status update by the TheKrazyCouponLady which has been shared 4 times. This query:

/10151794781777494?fields=sharedposts

Will return all the information about the users that have shared it. If you want to limit the returned fields to the name and id of the sharer, and the time and location it was shared, you could do this:

/10151794781777494?fields=sharedposts.fields(from,created_time,place)

Although I expect there won't be any location data most of the time.

To find the status id in the first place, you could just query the statuses field for a particular user. Again, using TheKrazyCouponLady (uid 255919387493) as an example:

/255919387493?fields=statuses

To get just the ids:

/255919387493?fields=statuses.fields(id)

As an alternative to that, you may want to consider querying the user's posts instead. The advantage to using posts, is that you can get back the share count for each post in that query.

/255919387493?fields=posts.fields(id,shares)

If the share count on a post is zero, then there is obviously no need to run another query to retrieve the users that have shared that post.

The downside of using posts is that the post id is slightly different from a status id. You'll see ids that look like this:

255919387493_10151794781777494

The first half of that string is the user id of the post owner. The second half is the actual status id. If you want to query the sharedposts field for the post, you first have to extract the second half (the status id) and use that for the query.

Having said that, it occurs to me that you could actually retrieve all the information you need in one go if you chain the statuses query and the sharedposts query together. For example, something like this:

/255919387493?fields=statuses.fields(id,message,sharedposts.fields(from,created_time,place))

That will return the status id and message text for each status from that user, and the user details, create time and location for each person that shared each of those statuses.

Even with paging, though, that is likely to be a fairly slow query, so I'm not sure if that's such a good idea. It's worth considering though.

这篇关于重新共享状态信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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