使用FQL,有没有办法获取用户发布的最后一条消息object_id
(user_id
已知)?
答案 0 :(得分:0)
SELECT post_id, created_time, message,
substr(post_id, strpos(post_id, "_") + 1, strlen(post_id))
FROM stream
WHERE source_id = me() AND actor_id=me()
LIMIT 1
stream
表格不提供object_id
字段,这解释了为什么我们必须减去一些字符串(substr
)来获取它。实际上,POSTID
就是这样的:USERID_OBJECTID
。
结果:
{
"data": [
{
"post_id": "1022361234_10201571234567890",
"created_time": 1383606736,
"message": "My message",
"anon": "10201571234567890"
}
]
}
使用过的doc: