问题
Can I fetch all Facebook events in a specific city? All I need is event IDs nothing else. It should be all events (public), not only someone's events. Will Facebook let us fetch that info?
回答1:
Elmcity does a simple search for a keyword in the event title. Try "Lancaster" for example. You'll get events in the UK, PA, NY OH and CA. You can also search for a non-location based word in the title like "picnic" and the script returns events.
You can try to query for events by location. With the graph API use the "Center" parameter in a search query:
https://graph.facebook.com/search?q=*&type=event¢er=37.76,-122.427&distance=1000
Run the query in FB explorer tool.
There is no way to query events via FQL by location.
The maximum distance is 50000 and is expressed in meters. There are limits to the number of records that are returned but you can use paging to retrieve further events.
As of writing this (Jun 2015), facebook silently ignores the center
parameter.
the source come from this post: Source Post
回答2:
You cannot query the event table without specifying an indexable column, i.e. an actual event Id. You could use the search functionality and query for event types, e.g.
http://graph.facebook.com/search?q=Dublin&type=event
http://graph.facebook.com/search?q=London&type=event
Once you get these results you could then further filter out these by timezone and location.
回答3:
While you can search for places or events near a place using the Facebook Graph API, I find this unreliable. Facebook does not expose standard categories to the API that allow you to filter on these, and there is no way that I am aware of to effectively search for venues that host events near an area and order them by relevance to what you are really looking for.
In practice, that means you can search for venues near a point. The Facebook API returns every coffee house that has an open mic night, but not an arena that hosts concerts.
Were I going to do this, I'd use this workflow:
- Query the Factual Places API to find the target venues for your search in the city of interest.
- Pass the result of that through the Factual Crosswalk API to get the Facebook IDs of those places, and concatenate them into an array.
- Use that array to query the Facebook Graph API for events at those places.
回答4:
Facebook search documentation implies that you can do a search for "objects" based on a location. For example you should be able to do https://graph.facebook.com/search?type=location&place=45386717890&distance=1000
to get a list of objects (including events) that are within 1000 (miles? km? they don't bother saying) of New York City (object #45386717890). However, I only ever get a blank result regardless of what I search near.
I'm guessing this feature is broken.
来源:https://stackoverflow.com/questions/13409763/is-there-any-way-to-fetch-all-facebook-events-in-a-specific-city