Get my wall updates - facebook

I'm trying to get the recent wall entries for my wall, so the url for this is dead simple:
https://graph.facebook.com/me/feed?limit=30&date_format=U&since=1308733229&access_token=<token>
Now, i'm just putting current time in place of since= and getting recent entries
But, the problem is, if something gets updated (someone comments my wall entry) it won't show up as something new
Is there any proper way to get new/recent comments OR to get updated wall entries? (fql may work too)

You can use FQL to get a little more control over what you are returning from your feed, check out https://developers.facebook.com/docs/reference/fql/stream/
How do you define new? As in content since the last time you polled the API? You could do this on your end by getting the difference between what you already have and the result of your latest poll.
Or if you would prefer pushed updates that only include the differences since your last update you can subscribe to the realtime updates API: https://developers.facebook.com/docs/reference/api/realtime/

Related

Getting Facebook page posts of the last hour/day etc

Is it possible to specify a time span for the posts returned by GET /v2.x/{page-id}/feed?
For example, I want all the posts of the last hour and only those...
EDIT: Just found the since and until fields for the feed. However, this only seems to apply to posts, not to comments on those posts...
Any way to apply the time span to both posts and comments, regardless?
Ideally, I would get a chronological list of messages (whether posts or comments) for the last X time units.
Graph API returns comments in same order as selected on actual post|picture|etc..
I already searched alot about this. Then i went for a stupid but simple solution. I can show you if you are willing to made 2 requests to graph api to get comments

Is there any way to pull the latest comments and likes from Facebook?

I am saving a particular media's likes and comments in the database. I am fetching the likes and comments of the media using Graph API every 1 hour to have the latest data. But Every time I fetch the data using Graph API, I notice that there is no particular order in which the data is returned. The latest comments and likes(new ones) may be returned in the second or the third pagination which is in no particular order.
Is there any way(any particular filter which we can apply) to access the latest likes and comments(new ones) made on a particular media.
Please Advise!
You can use the since parameter to check for new feeds. Simply store the updated_time field for the most recent comment you received, and then you can use that time as the since parameter to request the next set of comments.
https://graph.facebook.com/v2.3/<page-id>/feed?fields=updated_time&since=<last comment received>

Get a page's average number of posts / day using Facebook API?

I'm trying to figure out a way to calculate a Facebook page's average number of posts per day using the API. The problem is that the API does not show when the page was created. Instead, I'm downloading all the posts and using the oldest post as some sort of creation date (which is not 100 percent correct...).
The problem is when a page adds backdated posts. For instance, someone might post a picture in 2012 that's dated 2008. Then that post will be oldest, even if the page hasn't existed that long.
One solution is to go by the updated_time field instead of created_time, but it's not a great solution that still may not be correct.
Is there someway to get around this?
Sorry if this question has come up before, but I couldn't find anything on it.
Unfortunately what you're looking for isn't possible using the API.
For a given post two dates are returned - created_time and updated_time.
As you rightly pointed out the created_time can be updated to add a post in the past.
updated_time also will not work for you as this gets updated whenever someone comments on a post.
https://developers.facebook.com/docs/graph-api/reference/v2.3/post

Updating existing timeline posts using Facebook's Open Graph API

Is a POST to graph.facebook.com/?id={id}&scrape=true (as documented here) supposed to expire cache and update already-published timeline data immediately?
I have noticed in my case that when I update an og:image value for an Open Graph object page, enter the object's URL in the Facebook Debugger and then refresh my friend's Facebook timeline, I see the updated og:image immediately.
However, I do not see existing timeline open graph action publishes updated when using the graph.facebook.com/?id={id}&scrape=true method. It seems like my POST to scrape is not working, but the response I get is a JSON with all the updated data I expect.
I also notice that any new timeline posts for the same object have the new og:image referenced immediately, so it seems like the scrape is working - but not updating existing posts. Is there a way to force existing timeline posts to be updated as well, or is that working for others?
Thanks in advance
After a bit more research, I seemed to have a race condition issue here. Adding a delay to force the Facebook post a few seconds after persisting object changes fixed the issue for me.

Facebook Graph API does not give any data earlier than 2011?

I'm the author of Fazzle app on iPhone. What my app does is basically download user status updates and sort them in various orders (e.g. most liked, most commented).
I have been wondering if Facebook allow developers to get user's status updates since the day they joined Facebook, because when I launched the app I can only get user statuses from 2009. Today I just discovered that Facebook limits Graph API calls down to just since 2011.
I tried looking at documentations, asked around here, and contacted Facebook through their forum. However so far there is no word on this limitation in Graph API. Did I miss something? Is there any other way for me to get data for status updates earlier than 2011?
You can test it yourself here. Use this GET request:
https://graph.facebook.com/(your_user_id)/statuses?limit=99999
Scroll down and you'll find out that not everything's downloaded.
Is this because of conflict of interest with Facebook Timeline? If so, that sucks.
Logged as a bug here. Still hoping someone can point out my mistakes if there's any.
Absolutely you can get older posts from Graph API; there is no limit (at least not that I am aware of). Use the since and until parameters to page back through results, instead of offset:
https://graph.facebook.com/me/feed?access_token=[token]&until=1165474447
Documentation for Paging doesn't go very in-depth on since and until:
When querying connections, there are several useful parameters that enable you to filter and page through connection data:
limit, offset: https://graph.facebook.com/me/likes?limit=3`
until, since (a unix timestamp or any date accepted by strtotime):
https://graph.facebook.com/search?until=yesterday&q=orange
But basically, until is like saying "Give me posts up until this date", and since is similar, "Give me posts since this date". So you can scroll all the way back through a user's feed using a loop something like this:
// pseudocode
timestamp = now
do {
posts = graph.get(/me/feed?until=timestamp)
if posts.length == 0: break;
// process posts
timestamp = posts[0].created_time // first should be the oldest, in theory
} while (1)
Replace until with since and oldest created_time with the newest to go forwards in time, e.g. to grab any newer posts since the last time the user ran the app.
Facebook has since confirmed this as a bug. If you have followed Facebook's bug tracker ever, unfortunately that means there is very little if any chance they will actually fix this.
You will need to paginate. Limit is limited. Please read http://developers.facebook.com/blog/post/478/