tobilg/facebook-events-by-location

Date-filter (since, until) not working?

Closed this issue · 8 comments

Hey,

I made some little tests with your great tool to get Facebook-Events by a specific location and it's working quite good. But I have problems when trying to perform a time filter on the events with the since and until parameters. For example I've tried to filter events between 2016-09-14 22:00:00 UTC and 2016-09-30 22:00:00 UTC with the queries below. First I tried with Unix-Timestamp for the since and until paramter and then with a Date-String.

http://localhost:3000/events?lat={myLatValue}&lng={myLngValue}&since=1473890400&until=1475272800&distance=10000&sort=venue&access_token={myAccessToken}

http://localhost:3000/events?lat={myLatValue}&lng={myLngValue}&since=2016-09-14T22:00:00+00:00&until=2016-09-30T22:00:00+00:00&distance=10000&sort=venue&access_token={myAccessToken}

With each of these both request for example the second event in the received event list has ["eventStarttime"]=> string(24) "2016-09-11T13:00:00+0200", which doesn't match the filter. Can you reproduce this behavior or am I doing something wrong?

Can confirm that I am having the same issue. Have you figured out a fix?

If you have a look at the time-based pagination section of the Graph API docs, you can see that the since parameter is defined as

A Unix timestamp or strtotime data value that points to the start of the range of time-based data.

I would always use unix timestamps. Also the underlying library uses since, which seems to work.

The actual call is made via https://github.com/tobilg/facebook-events-by-location-core/blob/master/lib/eventSearch.js#L189 which seems reasonable as well.

any updates @valmcc @pmadruga?

Hi, yes it appears that my problems arose from events that were returned, that weren't within the dates that I specified. e.g. if I was to find events between 14th of March and 15th of March it would also give events on the 16th of March. I suspect it does this when it runs out of events between the 14th and 15th to give. I just filtered the output and it seems to be fine now.

You either need to specify the since and until values either specified as Unix timestamp, or as strtotime value.

it is the version 10 of the api and i still have the same problem even in the graph api

The whole api is deprecated since years @SAVE-POlNT

well, i'm still able to get the leads from ads from it , but in order to get new ads i have to navigate through all the old ones , sometimes i run the script for like 1 min to get only 2 new leads , maybe we are missing something , they are using graph api right ? we can query the data with it no ?