Tuesday, April 9, 2013

get realtime update of user infomation using facebook app

you can configure the framework according to the official document at:

http://developers.facebook.com/docs/reference/api/realtime/

if succeed, you can get the infomation like:

{ "object": "user", "entry":
    [    
         { "uid": 1335845740,      
           "changed_fields":
               [ "status" ],
           "time": 1365483292 }
   ]
}

It means the user(whose id is 1335845740 ) updated his status (most likely to post a new status).

what I want to say is, the 'time' 1365483292 you got is not exactly correct.

I use fql to crawl the status data and get the status created date is around 1365483292, but not exactly the same, say 1365483291. However, for some other times, they are  same.

So, if you got the update info as above, you should pay attention that "time" infomation.
if you still want to use this "time" info to crawl some latest data, you'd better use:


WHERE time BETWEEN $time-1 AND $time  // or something similar 

No comments:

Post a Comment