No new data after a RealTime update, and missing recent posts in OpenGraph /feed - facebook

I'm having a hard time getting access to most recent posts and comments for a given user using the OpenGraph API.
I have the read_stream permission, and get realtime notifications for feed field on the user object. The notification comes in, but fetching the /<user id>/feed stream doesn't include the new action.
When playing around with the Graph API Explorer, the data I see via OpenGraph and data I see by going directly to the page is different. Viewing my friend's profile, I see his latest update, yet it doesn't come back via /friend_id/feed. A comment I left a week ago shows in my /feed, but one from a few hours ago (which sent a realtime notification!) isn't showing up.
It's almost like some posts are filtered for the API. Is this how it's supposed to work?
My actual goal is to get all the comments made by my application's user.

Related

Does facebook have the data about when a user adds a reaction to a post?

I am trying to collect data about a post on facebook from its graph api. I am able to get all the other information (like comments, when the comment was created, who created it, etc etc) but i am not able to find the timestamp on the reactions. That is i want find out at what time (and date) did the user add the reaction. Does facebook have this information? If yes, then how do i get that information using graph api?
Does facebook have this information?
Most likely they do.
If yes, then how do i get that information using graph api?
You don’t, because they do not provide that information via API.
For a page you manage you could set up a webhook for the feed endpoint; that will get you updates for everything that happens on the feed - new posts, new comments, new reactions ... You’d have to filter out the reactions on your end, and then you could record them in your database with a timestamp that should be close enough. (That will only work for new reactions though, and not already existing ones.)
Yes , you can get details of comment by:
https://graph.facebook.com/{page-id}/{post-id}/reactions?access_token={page_token}

facebook push realtime api for public page instead of manually checking

It seems weird that I can get a public page feed on facebook (posts, etc) by doing:
https://graph.facebook.com/cnn/feed?access_token=ACCESSTOKEN
but I can't get that info with their realtime api? Is it possible just to have any changes (posts created) get pushed to me with the realtime api by subscribing to a page, for example the CNN facebook page? It seems silly to just keep on having to hit the graph api every x minutes and check to see if there are any new posts since the last post id when the realtime api could just push them to me. Does anyone know a way to do this? What am I missing?
Thanks
In order to receive real time updates from the page, the app needs to be installed on the Page.
The real-time update settings doesn't let you specify a page_id so there is no way for Facebook to know which pages you want to receive updates from.
Seeing as you won't have permission to install apps to pages you don't have admin access to, you are limited to the method you are already using at the moment. The only way is to continue querying the API periodically and checking for changes.

List Facebook Page events on website for a Venue using FQL or Graph API

I am helping out a friend with a site for a venue that lists all events on FB with a location, ticket URI, time, etc.
I have found lots of info on how to get the data, but what I am unclear on is how to get public events without being logged in to FB.
What type of tokens do I need to have a website simply pull events data and display it to visitors?
Basically, what I am attempting to do is show a set number of upcoming events and assume that the visitors to the site are not logged in to FB.
On this page, https://developers.facebook.com/docs/reference/fql/event, it says this:
Permissions
To read the event table you need:
a generic access_token for public events (those whose privacy is set to OPEN)
a user access_token with user_events permission for a user who can see the event for non-public events
an app access_token with user_events permission (for non-public events, must be the app that created the event)
a page access_token with user_events permission (for non-public events, must be the page that created the event)
I am not looking to get help with the code really, I am just having trouble figuring out how the access/auth process works.
It appears FQL may be the best option so I can do queries based on date ranges, but alas, I am stuck on the access/auth/token part.
What do I need to have in place to be able to list a Page's events on a 3rd party site?
If anyone has any advice there, I would appreciate it. Thanks.
Just to explain to others, you cannot get ALL the events in the city by graph search. You need to refine it either by user details or some other metric.
I figured it out.
This question helped, but was not correct and there is a syntax error in an answer:
Get Facebook events from public fan page
From what I found, you need to become an FB developer, create an app, get an ID and secret.
Use the SDK (PHP in my case), and this question had a good example of returning the list I want:
Link from ticket_uri is opening a blank page
I am having the same issue though of getting blank pages on the ticket link if the user is not logged into FB.
But my original issue is solved.

How to get Likes of Instagram photo posts in Facebook Graph API?

I am developing an app that processes <used_id>/posts connection to read the posts a user have made and count the likes and comments that have been received.
Yesterday I noticed that Instagram photo posts do not appear in posts connection. After a little search I found this Posts from Instagram not showing up on Facebook Open Graph API after which I was able to see Instagram photos in Feed connection if permission user_actions:instapp was added (or friends_actions:instapp for friend posts).
But two problems remain:
1) The posts still do not appear in Posts connection, which is more convenient for usage in my case because I am not interested in Posts of other users which may appear in Feed.
2) Even if I use Feed connection the posts do not have Likes field filled, does not matter whether I specify it directly or not. I assume that the same goes with Comments. Therefore in my case Feed is also useless because I need Likes data.
The only solution that works is by using <user_id>/instapp:take - there I get all photos also with Likes. So I might use it, but the trouble is - then I need to do double API call, because Instagram posts are not the only in which I am interested in (I still need to call <user_id>/posts).
I have submitted this bug report: http://developers.facebook.com/bugs/131821543664928
Perhaps someone has an idea for a better solution than calling instapp:take?
Thanks!

how to get past newsfeed using facebook API?

the API to fetch newsfeed is: https://graph.facebook.com/me/home?access_token=&limit=1000&untill=
which returns paginated feed output with 'next' url to fetch previous feeds.
However it stops returning newsfeed beyond a certain time. So newsfeed of few days is only available for parsing.
Is there a way out to get more historical newsfeed using facebook apis???
If you look at the graph API documentation page, /me/home is limited to only 1-2 weeks of history, and it has fallen into the "we don't care about this" category:
/me/home retrieves an outdated view of the News Feed. This is currently a known issue and we don't have any near term plans to bring them back up into parity.
Use /me/feed instead.
You can use the since and until parameters to get historical data from a user's feed. This will get you the posts that appeared between August 15-20, 2012.
/me/feed?since=2012-08-15&until=2012-08-20
The data returned by /me/feed/ is also limited. The limits aren't explicitly stated, but I never expect to be able to access more than 30 days worth of posts from one API call.