Facebook api - friends status updates - facebook

Very early in designing a concept and I was wondering whether it is possible using fb api to get a friends history of status updates? Or even a status update from a particular date in the past?
Hunting the documentation I am yet to see anything such as this so appreciate any guidance!
Thanks in advance

In addition to OffBySome's answer, you could use FQL, or more specifically, the stream table. This will let you query by dates, and filter more specifically, provided you have enough conditions to make the query indexable.

https://graph.facebook.com/friendID/statuses will provide you with all of a friends statuses. You can set limit querystring parameter to get more, and use "prev" and "next" elements to navigate back and forth. Try exploring on the Facebook Graph Explorer.

Related

How to get responsiveness from Facebook Graph API?

Is there a metric that I can pull from the Facebook Graph API that would tell me either/both Response Rate and/or Average Response Time from a page?
I'll attach a screenshot as to what I'm referring to:
I'm seeing this when I go to Settings -> Insights -> Messages, but would love to know how to pull this information from Facebook.
Anyone know the specific metrics or queries I could use to obtain this information?
EDIT: For anyone who offers the displayed_message_response_time, this doesn't work because it is set by the user AND returns a string (not numeric value).
Afaik there is only one way to get the reaction time:
Use /page-id/feed?fields=id,from to get all posts with the info who created them
Filter out the user posts with the "from" field
Get the time between the user post and a page answer (if there is one) post by post
Calculate the average response time based on the resulting times
I believe Fanpage Karma does it that way.

Get list of user's friends which contain other app post in their feed

After reading all facebook docs and google search i am posting this question because i unable to find the answer.
Application A - my application
Application B - Someone else application
I want to test user's friends who's feed contain post by Application B. I just need true or false without fetching their posts. because fetching feeds of every friend is slow and wrong way. is their any way to get list of friends in true or false way. Please suggest any single Graph API or FQL to get list.
thank you. Please help.
No, there is no straight “true/false” query for that.
You could just filter the contents of the FQL stream table by app_id for each friend, and use LIMIT 1 to break the search off when the first post made through that app for that user is found.
And of course you could make that a multi-query, to fetch the data for all friends at once, to limit the number of necessary HTTP requests.

Facebook API friends work and education recent changes

Looking at Bright website, I'm trying to figure out how they achieve their Latest Activity pane. Basically, sign in with Facebook on their website gave me all my friends work recent changes, ordered by date. Take a look here to see what I mean:
This is what I've done at this time so far:
Used friends_work_history permission and retrieve work field like /me/friends?fields=name,work with Graph API. While that gives me friends work history as well as their current position, I still can't obtain the date of the latest change of their current work employer.
Looking into the feed object (also using Graph API) as well as the stream object (using this time FQL) of my friends, to see if I could filter work changes. Still no luck. I just can't find any story or activity related to their work.
Now, correct me if I'm wrong, but it seems to me that's rather impossible to obtain such friends work changes with date. In the best world, what we would like to achieve is, when a user uses our website for the first time, and sign in using Facebook, we would like to show them such "Latest Activity" as you can see from the image from Bright.
If that's really not possible, we will forget the idea of seeing an history of the lastest work updates among friends, and we will focus of taking a "snapshot" of the present, and work from there. We could try either:
Using our own tracking system, which will basically consist of pooling the Facebook Graph API at some time during the day to see if we could find any changes in the work history of user's friends.
OR
Maybe use the Real-time Updates service of Facebook https://developers.facebook.com/docs/reference/api/realtime/, which could maybe allow us to track these kind of changes. But the more I think about it, the more I guess it will not work since it will not allow us to track changes on friends work field.
Anyway, maybe someone was able to solve that problem? Thanks in advance!
You should be able to get at this using FQL. I can't find a friend who changed jobs recently, so I can't validate what this should be.
Using something like this:
SELECT post_id, message, type, attribution, description,description_tags FROM stream
WHERE source_id IN (SELECT uid1 FROM friend WHERE uid2 = me()) AND
strpos(description,"added a job") > 0
Should get you those posts. My guess is that these have a unique type value, where you can filter these more efficiently.
Don't forget that the stream table is hobbled to return only the last 30 days worth of posts. You'll need to execute multiple queries to get at any significant history.

Get the date when two users became friends in php

It's possible to get the date when two users first interacted on Facebook? For example: in a comment, photo tags, wall post, etc. I need this for a FB app since isn't possible to get the date when two users became friends.
Any idea of I can get this done?
I'm thinking in merging a lot of fql queries but don't figured how to do this yet. If I want this for all my friends, isn't gonna be too slow?
It is possible now to extract dates from which you became friends with another user on Facebook. Try it via the API Explorer Tool: https://developers.facebook.com/tools/explorer/?method=GET&path=UID%2Fposts%3Flimit%3D25%26until%3D1342599743
No, unfortunately it is not possible with the API for existing friendships.
But you should be able to use the Real-time updates (https://developers.facebook.com/docs/api/realtime) to be notified when they become friends with someone. Currently the documentation say they support the friends user connection.

How would I get a list of 'friends' who have added my Facebook application?

I'm really struggling with something that should be a simple matter: Showing a user of my Facebook app a list of their friends also using the app. Is there nothing built into the APIs to allow such a common request?
The only thing I can think of to do is to get the list of the user's friends, and then get all the users from my database who are in that list, and then fetch information for each of those facebook ids. But that seems an extremely roundabout way of doing things...
The only way I've found to do this is to use FQL and a previously documented, but now undocumented field:
SELECT uid,name FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1=<user's uid>) AND is_app_user=1 ORDER BY name
The undocumented field is the user.is_app_user, which is listed in the old documentation wiki but not in the shiny new docs. No idea if this means it'll be removed in the future, but there doesn't seem to be any other way to get this data with the new Graph API.
Just in-case you're still using the old REST API, you can also call the friends.getAppUsers method.
You can actually use Facebook's old REST API to do this by sending a GET request to: https://api.facebook.com/method/friends.getAppUsers
If you need JSON data back, then add the parameter format=json
You need an access token to do this. See the documentation here:
http://developers.facebook.com/docs/reference/rest/friends.getAppUsers/