tobilg/facebook-events-by-location

Query by Facebook category

Closed this issue · 10 comments

c1p81 commented

Thanks for your work
i would like to ask if it's possible to filter the events also by Facebook category

Thanks
Luca

No, there's currently no such functionality. The FB APIs do not offer to filter on the event's category, which means that the filter would have to be implemented in https://github.com/tobilg/facebook-events-by-location-core after it received the Graph API results...

PR are welcome!

c1p81 commented

Thanks for the quick reply
i'm sorry but i'm not english ...what means PR ??

PR means pull request. You can have a look here for a description: https://help.github.com/articles/about-pull-requests/

As a hint, you can also just iterate over the returned JSON and filter in your client application for specific event types, e.g. if you stored your JSON in the the data variable and are intersted in the MUSIC_EVENT category:

let myEvents = [];
data.events.forEach(function (eventObj) {
  if (eventObj.category === "MUSIC_EVENT") {
    myEvents.push(eventObj);
  }
});

You can use a category filter on Places Graph in facebook-events-by-location-core to add a parameter to the graph URL. This helped me to increase the number of places returned to get more events in a given radius. But I wonder if every place is assigned to a category.

Hi everyone.
What about iterate recursively on the places search for all types:
ARTS_ENTERTAINMENT, EDUCATION, FITNESS_RECREATION, FOOD_BEVERAGE, HOTEL_LODGING, MEDICAL_HEALTH, SHOPPING_RETAIL, TRAVEL_TRANSPORTATION.
Then do the event search.
This should help to increase the number of events that it can find.

Greetings.

@vrgomes, unfortunately, the Facebook data API is not perfect (or buggy as hell). Not all places are assigned to your mentioned top-level categories. I tried this in my hometown and I got different results when searching for places with category parameters and searching places without.
To get nearly all Places you would have to compare the results to another API, get the delta, then get the Facebook IDs through name + address and finally retrieve facebook places + events again.

Furthermore, it's to note that the category mentioned is a place category, not from the event itself.

@Lukas1Komarek I don't think it'd be practial to implement a process as you described, because this would take too much time (and has penalties regarding the rate limit I guess).

@vrgomes I tested specifying all categories to place searches, and specifying no categories at all. The former increased the number or results ~10%, but also returned not just more results, but also about 20-30% different results than using no categories at all, which is strange to me.

I tend to think that it'd make sense to implement the category search (as optional), and leave the default with no categories attached in the query, instead of all.

Hi!
It looks promising. I'm going to test it!
Is it possible to run all the categories + null category and then clean up the duplicates? This should give an increased number of results.

Greetings.