Вопрос

Using FQL, is there a way to get the object_id of the last message posted by a user (the user_id being known)?          

Это было полезно?

Решение

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

The stream table doesn't offer an object_id field, which explains why we have to make a little string subtract (substr) to get it. Indeed, a POSTID is made as such: USERID_OBJECTID.


Result:

{
  "data": [
    {
      "post_id": "1022361234_10201571234567890", 
      "created_time": 1383606736, 
      "message": "My message", 
      "anon": "10201571234567890"
    }
  ]
}

Used doc:

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top