Unable to retrieve events created by a page - facebook

I have tried with EVERYTHING, graph, FQL, access_token with all permissions granted, multi-queries... now I'm really tired! Someone can tell me HOW to retrieve all the events created by a page like this? http://facebook.com/mammamiasantateresa
I want to know why this query doesn't work:
SELECT eid, name, description, location, pic_big, start_time, end_time, is_date_only FROM event WHERE creator = 229315807171062
But instead, this query with this page: 205712556144006 (/fifteenonline) who has only an event, or with Coldplay's page 15253175252 (/coldplay), who has many events, it just works!!! I wonder why. Nobody for weeks gave me a response. Please, it's very important for me. Thanks!

Your query is OK and if this would be an event it should be worked. But the thing you're looking for is a post on a wall, not an event, and it could be found via searching in stream in Graph API or FQL query:
Graph API request:
http://developers.facebook.com/tools/explorer?method=GET&path=229315807171062%2Ffeed
FQL Query request (with 2 fields, but anyway this post is there):
http://developers.facebook.com/tools/explorer?fql=SELECT%20message%2C%20updated_time%20FROM%20stream%20WHERE%20source_id%20%3D%20229315807171062

Related

How can I get all my posts to other people, not to my timeline?

How can i get, using Facebook Graph Api, all my posts to other people, not to my timeline?
I'm trying to use me/posts , but i get all my posts including to my timeline, and i couldn't separate it
Using Facebook FQL API:
SELECT post_id, created_time, description, description_tags, app_id,
message, type, created_time FROM stream WHERE source_id=me() AND
comment_info.can_comment!='' AND actor_id=me() AND permalink="" AND
created_time<=now() LIMIT 150
The only problem is this query doesn't return "Upload photo on friends wall"'s post, because of this unresolved bug at https://developers.facebook.com/bugs/148353975327544. However, this FQL query should works perfectly. Kindly let me know if you're figure out something wrong with this query.
Also, please make sure your user access token have granted "read_stream" permission.
comment_info.can_comment!='' used to exclude "Comment on friend's Status" story feed.
permalink="" used to exclude "Lim and 林果皞 are now friends." or "People changed his profile picture.", "林果皞 created an event."...etc. You can test what would happen if remove this.
Update for comment below:
I think what you can do is extract the id from description_tags which was no start with "0", for example my screenshot, id "100003013144869":
Also, extract the created_time, for example "1368624514"
Then, do a query with:
SELECT post_id FROM stream WHERE source_id='100003013144869' AND
actor_id=me() AND created_time=1368624514
I'm know it's not absolutely accurate(If 2 feed have the same created_time on seconds), however most likely you can make your job done.

Facebook API Friend Location object being returned with empty string for id and null for name

Yesterday, when I retrieved my Facebook Friends from the Graph API using the query "me/friends?fields=id,location" 500+ came back with location data.
Today, 500+ are returned with the location object, but only 36 have any data in the location object, the rest are returned as:
"location": {
"id": "",
"name": null
}
You can reproduce it yourself in the Graph API Explorer. You'll see that some friends have legitimate locations, but the majority have the null values. Does anyone have any idea what's going on? This happened to happen the same day Graph Search was announced. Is it related? How do I fix this?
UPDATE: Facebook has updated the status of the bug that I posted to "Fix Ready" so this should be resolved shortly... https://developers.facebook.com/bugs/487611667944115
As Zachary mentions, it is probably a facebook bug. However they marked the bug as 'medium' priority and could take forever to fix. If you need to get yourself up and running quickly again, switch to an FQL call instead. The following correctly returns location data for all your friends:
SELECT name, uid, current_location FROM user WHERE uid in (SELECT uid2 FROM friend WHERE uid1 = me())
If you're also looking for hometown info, though, then tough luck. Seems like the bug mentioned also affects FQL in this case...

Facebook Graph API does not return the event picture

Edit: Seems like Facebook finally fixed this bug!
Could you help me understand why this is happening:
This is a public event with a picture:
https://www.facebook.com/events/282054218538223
But when I try to access http://graph.facebook.com/282054218538223/picture, all I get is a default picture.
Here is another public event: http://www.facebook.com/events/266496120103339
But this time, accessing http://graph.facebook.com/266496120103339/picture returns the event photo.
What's the difference between the 2 events?
This answer doesn't explain why the request doesn't work using Graph API but might help someone who needs to to retrieve event profile images.
With FQL you can retrieve the event profile image like this:
SELECT pic, pic_small, pic_big FROM event WHERE eid=282054218538223
using the event id from Robin's first example. This call returns urls to the event profile image in 3 different sizes. It works for both examples in Robin's question, just change the event id.
Try it in Graph Explorer with Robin's example:
https://graph.facebook.com/fql?q=SELECT pic,pic_big,pic_small FROM event WHERE eid=282054218538223
and MoXplod's example:
https://graph.facebook.com/fql?q=SELECT pic,pic_big,pic_small FROM event WHERE eid=271148229633674
Make sure you have access token if needed as outlined in the FQL event table.
having the same problem. it appears to indeed be a bug with the Facebook Graph API.
I currently count at least three separate open bug-reports on the Facebook Developers Bugs page that describe and reproduce the problem (you may need to be logged into FB to access the information) :
Cannot retreive picture of newly created events via Graph API
Some event covers not available via Graph API
Event picture is not accessible via API
fwiw, it might be a good idea to subscribe to all three (duplicate) bug-reports.
I was fighting with this problem this evening. The docs are saying to use picture but what I found exploring fields is this one:
{event-id}/?fields=cover
which finally returns:
{
"cover": {
"offset_x": 99,
"offset_y": 50,
"source": "{url}",
"id": "{id}"
},
"id": "{id}"
}

Facebook Graph API: feed method results are missing type: status from: me

I'm using the graph API to fetch status that I posted to my own wall.
I have tried using the graph API statuses method and I am able to get my most recent 100 status updates:
a query like this: /me/statuses?since=2010-09-01&until=2010-10-01 returns many results for my account.
similarly, I would expect this query: /me/feed?since=2010-09-01&until=2010-10-01 to return those same posts from me to my wall (i.e. type: status, from: me) as the above query, along with posts to my wall from others, etc..
what actually happens, however is that the /me/feed query above returns all posts EXCEPT those from ME
Can anyone explain this behavior?
*it seems to be related to the time, for example if i only go back 2 months (eg: /me/feed?since=2011-12-01&until=2012-01-01), everything works fine

realtime api feed - how to get new comments?

I made it to subscribe to the realtime api and retrieve update messages telling me the uid and time when the item changed. But how do I get the corresponding post/comment. I tried to use the fql but unfortunately there seems to be a bug in the fql when using updated_time.
This is my query:
SELECT post_id, actor_id, target_id, updated_time, message FROM stream WHERE source_id = me() AND updated_time >= "pushTime"
where pushtime is the time I got from the realtime notification.
It works for getting a standalone(no comments) post but as soon as there are comments it does not work. When I go through all posts and check the updated_time I can find the correct post.
My only solution for the time being is to iterate over all posts until i find the post where updated_time == "pushTime".
Anyone another solution?
If you have stored previous comments then retrieve the last comment ID you have stored and use that to query facebook for comments with an ID higher than that.