简体   繁体   中英

Querying for past events using FQL

I'm trying to access the past events of a given user. I'm using the following FQL query: SELECT eid, name, pic_square, start_time, end_time, location FROM event WHERE eid IN (SELECT eid FROM event_member WHERE uid = me() AND rsvp_status != 'declined') AND start_time < 1338974650 ORDER BY start_time DESC LIMIT 0,20 ( 1338974650 is supposed to be the current UNIX timestamp). This works fine. However, facebook only returns a set of 4 events in my case, whereas facebook.com displays a lot more. Why is that?

Yes. Facebook severely limits the amount of past items returned by an API call. When I visit one of my pages, I see over 75 events listed on the past events page. When I query the page's events using either FQL or Graph API, I only get 2 events. My guess is Facebook has a separate table that stores past events that isn't available via the API.

BTW, You can make your code simpler by replacing your timestamp with now() .

if you query the event_member table by passing the uid, you will get all the events that were CREATED by the user. if you query the table by passing one eid, it gives you the members of the event and their rsvp statuses.

EDIT: try setting start_date > 0 as stated here it should show you ALL the events.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM