Currently the best (and perhaps the only) way to check if user is online on Facebook is to check his FQL online_presence property from users table. But since FQL gonna be deprecated soon (together with XMPP), it won't be possible to retrieve online_presence anymore.
Is there another way to get user online status (perhaps from Graph API)?
There's no way I know that you can get the online_presence from a Graph API endpoint. It's missing in the /{user_id} fields (see https://developers.facebook.com/docs/graph-api/reference/v2.0/user/)
IMHO, you can continue using FQL until August 7th, 2016, so I'd recommend to stick with your current solution. Maybe the Graph API is updated in the future to also return the online_presence.
online_presence is a very old FQL query that was removed several years ago (back in v2.0). According to this StackOverflow post, it is no longer possible in any way.
Related
I am migrating the Facebook API that I use, from FQL v.1.0 to Graph API. I discovered that some things have deprecated. My problem is related to getting all the users that are using my application.
In FQL I can do this with:
/fql?q=select+uid+FROM+user+WHERE+is_app_user+AND+udi=
Question 1 : Table user contains all the users friends and non-friends? Or just the friends?
In Graph Api, I have understood that is_app_user is not used anymore, instead there is fields=installed that does the same thing.
I have found two ways of using fields=installed :
me/friends?fields=installed
OR
me/fields=installed
Question 2 : There is a difference between these two syntaxes?
Many thanks for your help.
Passing installed as parameter with /me/friends makes no sense because
/me/friends
returns only friends who are already using the app.
With v2.0, Facebook has made it impossible to fetch users who are not my friends but are using the app. If you still need such users,the best solution would be to store the user-ids of all your app users in a persistent storage. A workaround using FQL should be avoided as its getting deprecated too with v2.1.
How to read Facebook comments based on updated time through API?
I tried "since" and "until" but both are reading the data based on created time.
for example let us assume a user created a post on his timeline two days back and someone commented on the post today. If I try to read the comment done on today using the following query /me/feed?since=2014-09-08 it doesn't return anything because the created date is two days back.
There's unfortunately no way to query the Graph API concerning the upate timestamp IMHO. since and until reference the created_time, as you said.
If you have a Graph API v2.0 app, you could theoretically use FQL to query by comment creation timestamp. Have a look at the comment table at https://developers.facebook.com/docs/reference/fql/comment/ and the field time. I guess you'd have to in conjunction with the stream table to get the post_is list.
To be able to use FQL you'll need an app which is an Graph API v2.0 app. And FQL will only work until April 30th 2016.
One of our apps uses FQL (more specifically the table url_like) as part of the core functionality.
With the upcoming deprecation of FQL we were wondering what is the Graph API endpoint (or set of endpoints) that could provide the same functionality (see likes on friend's links).
So far we haven't been able to. Any clue?
Much much appreciated.
Well, as far as I know there's no way yet to do this in a pure Graph API request. To get the total_shares, you could use something like
http://graph.facebook.com/?id=http://www.google.com
but this sums up all likes, shares, comments etc. so it's probably not what you're looking for.
You could use
https://api.facebook.com/method/links.getStats?urls=http://www.google.com&format=json
but this is also deprecated, and it's unclear how long this will work.
FQL by the way will be around for another 2 years after the next version of the Graph API will be released, see https://developers.facebook.com/docs/apps/versions#versioning So, for now I'd recommend to stick with the FQL solution.
Hava a look at How to get share counts using graph API to get some more info.
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.
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/