Get count of Facebook status messages WITHOUT reading them all?
I want a simple thing with Facebook API, but I don't know if it's possible.
I am building a PHP app (with the official facebook PHP api), that does something with user's status updates. What I would like to know is their total count.
However, as I found out, reading ALL status messages by something like
$facebook->api('/me/statuses?limit=2000');
takes too long (and fails, half of the time), since the result is too big (it returns all the updates, plus all the comments and "likes").
Facebook documentation is quite confusing, so I am asking he开发者_如何学Pythonre - is there any way of getting the count, without reading them all?
Probably FQL would be faster:
SELECT status_id FROM status WHERE uid=me() LIMIT 2000
FQL doesn't support COUNT
, but you can select an empty string, that way amount of returned data would be lighter (array of empty elements is returned):
SELECT "" FROM status WHERE uid=me() LIMIT 2000
精彩评论