I've been trying to figure out how to do this, and was thinking it wasn't possible, then found this website: (Removed due to a dead link)
You can search by city there and I have no idea how they do it? The normal graph API's don't allow searching for events by location as far as I can see. Any advice/tips/info would be great!
Updated 2014-07-02
You can't directly search the Facebook API for events near a location. Since originally giving this answer, the Graph API has made it harder to search for events.
The Elmcity script referenced by the OP does a simple search for a keyword in the event title. Try "Lancaster" for example. You'll get events that have the word Lancaster somewhere in their metadata.
Their query looks something like this:
https://graph.facebook.com/search?q=lancaster&type=event
You can also search for a non-location based word in the title like "picnic" and the script returns events.
For the problem of actually finding events near a location, in the current iteration the "venue" field is only a string, so it has no relationship to any Facebook place. Running these query returns nothing:
https://graph.facebook.com/madisonsquaregarden/events
https://graph.facebook.com/108424279189115/events
So using a batched request isn't even a possibility.
According to the documentation FQL seems to be a better solution. In the event documentation, the venue.name column is indexable! Easy, right?
Wrong. When you run this FQL query to find events at some location like this:
SELECT name, start_time, venue FROM event WHERE CONTAINS("madison square garden")
You find that venue.name isn't populated.
Trying any other variation like:
SELECT name, start_time, venue FROM event WHERE venue.id = 108424279189115
Throws a "statement not indexable" error.
So while building a "Facebook Events Near Me" is the killer app, the only way that it seems possible is to search for common strings for events near you, get those events, then filter out irrelevant events from the result set.
This JavaScript library on GitHub seems like an interesting approach to look at. It uses a places search and then does an events search on those places.
tobilg/facebook-events-by-location-core
As of recent. the Events end points have been deprecated due to the privacy issue.
Your app will now need to be reviewed first to access events api, when it resumes.
Events and points has been deprecated due to privacy issues. Now you have to review your app before you can access events api. After successful approval you can search events.
So what you can do is enter "Events", but you need to enter the date, or tomorrow after that. Then, on the right, in your filters, enter the location field, select other, then punch in the location you want.
Related
I'm facebook graph API user.
Recently found that since parameter works weird.
I'm using that to find all upcoming events and filter out past events for a particular venue.
For instance:
When I use query like this
/v2.5/481931581856759/events?access_token=&limit=5
I getting all events.
But if I add since variable, some events are missing
/v2.5/481931581856759/events?access_token=&limit=5&since=1471468270
In this case can not find an event with start_time "2016-10-28T19:00:00-0700".
Why that happens or I misunderstand something?
Not really sure what happened, but Facebook does not want to return all of the events for a group anymore. It is just returning one last one. The thing is that it was returning everything before, but now just one event. I don't know whether I changed somehing for the permissions or group settings..
Here's the Graph API query I have:
https://graph.facebook.com/[group_id]/events?since=1349654400&fields=name,start_time,location,id,description,picture&access_token=[token]
I included a since parameter that goes back to 2012, but still only get 1 event.
If I go to the FB group page, I can see a list of the events, so they are there..
any idea why this is happening?
EDIT:
The FQL query does return all of the events:
SELECT eid, name, description, pic_big, start_time, end_time, location
FROM event WHERE creator = [group_id]
Makes me even more confusing as to why graph API query is not working
In the Graph API query, try using the limit parameter also.
sometimes you just need to tell graph-API that you want ALL the results. you may need to set the limit of returned results to a bigger number.
try this:
GET /v2.5/[group id]/events?limit=10000 HTTP/1.1
Host: graph.facebook.com
also, try changing both "since" and "until"
I am fetching a list of tracks from soundcloud's API using the following query to retrieve the 5 most popular tracks:
https://api.soundcloud.com/tracks?client_id=XXX&order=hotness&limit=5
But recently SoundCloud removed the hotness order. In the blog post they say tracks can instead be sorted by playback_count. But can this be done in the query or do they suggest I pull down the whole SoundCloud library and order them in the client? The following doesn't seem to work:
https://api.soundcloud.com/tracks?client_id=XXX&order=playback_count&limit=5
So how would one retrieve the top tracks on SoundCloud?
The solution was to use the undocumented calls for the explorer feature that SoundCloud itself uses (I used the dev tools in Chrome to check the AJAX calls).
https://api.soundcloud.com/explore/sounds/category?limit=L&client_id=XXX
This appears to use some sort of sorting on the popularity of the songs. The songs can then be filtered on only music by checking the "grouping" attribute. I then have to resolve the list of IDs to actual songs which can be done with the (documented, official) API call:
https://api.soundcloud.com/tracks?ids=1,2,3&client_id=XXX
This seems to work perfectly and I also get the added benefit of an even distribution among genres. But of course, this can stop working at any moment since the API calls are undocumented and perhaps not meant for public use.
Just wanted to provide an update. It seems soundcloud has moved to v2 of the explore API call.
Use this to get a list of categories:
https://api.soundcloud.com/explore/v2
And this to get tracks from a category:
https://api-v2.soundcloud.com/explore/metal?limit=10&offset=0
So far it seems to without a key, although I have no idea how long that will last.
EDIT: So the 2nd url doesn't seem to allow cross-origin, but so far this does work, though it only returns the trackID not the full information
https://api.soundcloud.com/explore/v2/metal?limit=50&consumer_key=XXX
check here, soundcloud removed order by hotness.
Has order by hotness been removed from Soundclouds API
so, for now, only order by date is possible.
I have built a Facebook app using OpenGraph that permits the users to write reviews on concerts, so that I've defined a concert_id attribute on which the user can insert a review.
Now I would like to show all the reviews inserted for a certain concert_id but cannot find a way. If I do (in JS)
FB.api('/me/MY_APP:action', { limit: 0}, function(response) {
console.log(response);
});
I get all items. This app has to be consumed by mobile, I think it is bad to get all items and, then, filtering only the concert_id i need. What do I have to do to apply a where condition in OpenGraph to a custom action?
As far as I can tell from the API and the Facebook developer pages, it's not possible to filter a call by custom action property using the public Open Graph API.
Two options I can think of:
Option 1:
Implement the category filter by creating custom category objects:
if "review" is a custom action and
GET https://graph.facebook.com/me/[name_space]:review
returns all review actions then
GET https://graph.facebook.com/me/[name_space]:review/scifi_movie
GET https://graph.facebook.com/me/[name_space]:review/action_movie
return actions specific to movie type, where scifi_movie and action_movie are custom objects. You would need to create one object type for each category.
Option 2:
Implement a custom action for each category, e.g.
review_scifi_movie
review_action_movie
These are not particularly elegant solutions but perhaps useful as a hack if nothing else works and you really don't want to do filtering on client side.
The Facebook API will not return individual published objects for a particular action, but that's not your only problem. By the look of it, you're trying to bring in ALL the reviews given for a concert, right? (Meaning those by other users too).
The "/me/" part of the Facebook API call will only return those published actions made by the user that is currently logged in. That won't work for you, as you want those of all your users
The only suggestion I can give is to create a simple web service, where you store all the reviews given for the various concerts. Use this service to pull in reviews given for a particular concert. (I use a similar methodology for reviews in an app of my own).
I dont understand javascript or opengraph..
But when I required in JAVA to fetch reviews made by any user I have used FQL for that and It retrived me all the reviews and FQL also used to fetch all the tables related to Facebook.
I don't think that you can pull that off with the JS SDK.
You can do that in your server though, and since this is a mobile app (or has a mobile version) then that's another good reason to remove this from the client responsibility.
In the server side you can ask facebook for the published actions as you posted, filter them and then return the response.
Another thing that you can do is to save each published action in your db (on each action post you should get an id back from facebook, just persist that) and then you can easily filter the published actions according to what ever criteria you want/need (since you are no longer restricted by the facebook api).
The open graph thing is still pretty new and not tat mature, for example you can't use FQL with it, something that could have been handy for your case.
Regardless though I think that a server solution is best for calculations when mobile is concerned.
i don't know exactly but try this
if (session.authResponse) {
FB.api('/me', {
fields: 'name, picture' // here mention your fields
},
function(response) {
if (!response.error) {
//here response value
});
I'm checking wich fields from the User object are susceptible to RTU (real time updates); in the documentation it says:
The User object supports Real-Time Updates for all fields except the
verified property.
But, so far, for this fields:
video upload limits television significant other favorite_teams
favorite_athletes political interested_in bio updated_time
third_party_id gender user_likes languages
I've got this message:
{"error":{"message":"(#100) \"SOME_FIELD\" is an invalid field name","type":"OAuthException"}}
My application has the necessary permissions, checked by using this method (taken from this url):
https://api.facebook.com/method/users.hasAppPermission?ext_perm=SOME_PERMISSION&uid=UID&access_token=ACCESS_TOKEN_FOR_MY_APP
Am I missing something? Those fields are working for someone else or is just me?
Thanks.
I've tried the same. Facebook seems to be a little slow here. They did not implement all fields in the RTU. You can find a list of available fields here (under objects): https://developers.facebook.com/docs/reference/api/realtime/
However, even this list does not seem correct, as I did not get for example television to work either.
It is kind of odd to ask for the object "user" to get notifications about you page.. This all does not seem to be finished yet..