1

我对这个 FQL 查询感到困惑:

SELECT type,attachment,message,permalink,created_time
FROM stream
WHERE
  source_id = xxxxxx and
  actor_id= xxxxxx and
  type = 247
ORDER BY created_time DESC
LIMIT 46

它返回空。但是当我尝试这个时:

SELECT type,attachment,message,permalink,created_time
FROM stream
WHERE
  source_id = xxxxxx and
  actor_id= xxxxxx and
  type = 247
ORDER BY created_time DESC
LIMIT 50

正如我所料,它返回 1 条记录。

是因为这个LIMIT还是别的什么?如何显示用户的 15 个帖子?

4

2 回答 2

0

这是 facebook 的一个怪癖:一些帖子从回复中“隐藏”了。因此,前 45 个帖子全部隐藏(鉴于您用于获取帖子的凭据),接下来 5 个中的 1 个(一个)是可见的。所以它只返回可见的。增加限额,您可能会得到更多。

除了不包括限制,然后手动计算和使用前 15 个之外,没有真正的解决方法。

于 2012-06-21T04:11:22.550 回答
0
List<WallPosts> posts = facebookClient.executeQuery("select strip_tags(message),type from stream where filter_key = 'others'",WallPosts.class);
Iterator<WallPosts> postIterator = posts.iterator();
int wallCount = 0;
while (postIterator.hasNext()) {
  if (wallCount == 15) break;
  WallPosts post = postIterator.next();
  if (post.message != null) { // if message is not blank
    wallCount ++;
    System.err.println(post.message);
}

将从其他人那里获得经过身份验证的用户墙上的最后 15 条消息。有些消息是空白的,这就是我进行空检查的原因。

于 2012-09-19T21:25:10.467 回答