I'm trying to get the number of recent checkins for multiple facebook places. I'd like to setup a CRON script that queries for recent checkins using something like:
SELECT tagged_uids FROM checkin WHERE timestamp > 1318514998 AND page_id IN (138444418096,138444418097)
But since this is a (fb userless) cron script, how can I get an access_token? I've tried getting one for a facebook app, but that didn't work.
You need to get an offline_access token and make sure that your script is on the same domain as your FB app that generated this token. BUT I don't think you can retrieve these info if you don't own the page.
Related
in our game I'm checking if user is liking some of our Facebook sites.
For most users its working but there are some complaining that they are
having problems with this functionality.
1) I'm requesting "user_likes" permission during logging to Facebook
( users must be logged ).
2) I also take into account so called "paging" of result via Graph API.
( I'm retrieving all user's like-ids piecewise and after many tests
I assumed that it's working fine :o) )
3) Those users that were reporting that this check isn't working
really "like" those sites (before running this check).
So my assumption is that request "me/likes" fails or doesn't work
as expected under some conditions. Can someone help me with this
problem?
It seems that I'm not alone because I found these (unluckily unanswered):
https://stackoverflow.com/questions/10772814/checking-facebook-graph-api-for-user-likes-fails-for-some-users
http://facebook.stackoverflow.com/questions/10109773/cant-obtain-user-likes-in-some-cases-using-facebook-graph-api
The only cause I can think of is the Graph cache not being up to date with the user's Like data. If the user only just liked a page, and then you requested the Like data via Graph API, the data may not have been updated yet and therefore would show up as a "non-Liked" page.
Try using a FQL query to do the same check - but instead of paging through the user's like, do a direct check on the Page ID, User ID and Like status. You will have to join across multiple tables to get it working.
I'm tring to get my friends' birthdays in my app and some of them are null. I thought that those people don't have a birthday set, but they actually do.
My fql query is:
SELECT uid,name,birthday_date FROM user WHERE uid IN (SELECT uid2 from friend where uid1=me())
The birthdays are also null when I request /me/friends?fields=birthday
My access token has the friends_birthday permission set.
I also tried with birthday instead of birthday_date in the FQL query. Same result.
I imagine that this happens because they opted out somehow, but I don't know how.
Is there an alternate solution to actually get their birthdays from facebook?
It's also possible to remove the ability of apps to access your data when your friends use them, this option will prevent the current session user from seeing some information about their friends via the API, even if that information is accessible on Facebook.com
This setting is in the privacy settings, at https://www.facebook.com/settings/?tab=privacy, under Ads, Apps and Websites -> 'How people bring your info to apps they use' and looks like this:
{edit} you can test this for yourself with test users, it's the most likely reason assuming the birthdays are visible to you in the frontend
These people might have set their Birthdays visible to only themselves or only some restricted friends. This is an option available if we try to edit our Birthday by its side. That can cause it is not available to your query by app.
I am trying to determine if it is possible to get a list of Facebook users and IDs (via JSON I assume) that have checked in to a place/page.
Is this even possible? Do you need an access token from each user account to access this information? I found Facebook's documentation to be less than helpful...any help will be much appreciated!
You can query the FQL checkin table but at most (based on the permissions granted) you'll get the user's & her friends' checkins.
We run some facebook pages for our clients and we'd like to run off some reports, like many people LIKED those pages yesterday, for example.
I can see that this can be done by FQL, but you need an access_token to run the queries using Facebook Graph API in (C#).
For these Facebook pages there isn't an app associated with them, so without app_id how can I get authenticated to be able to run those queries ?
Thanks
You could create an app that you then use to retrieve the stats.
If you then get an access token for a user that is an admin of the pages and request the read_insight extended permission you can get the insights data for each page, which will give you plenty of stats to report in a handy JSON format.
See here for more details on the insights in the graph API
http://developers.facebook.com/docs/reference/api/insights/
This used to work for me before, but some time ago I realised it doesn't work any more. I'm trying to run a FQL query for retrieving user_online_presence status (whether user is available for chat) on facebook. So, my query goes like this:
SELECT online_presence FROM user WHERE uid=userID
where userID is the actual user id on facebook.
But, regardless I'm online or offline on facebook, this query always gives me 'offline' status instead of 'active' (or 'idle').
To reproduce this on your own, simply go to the Graph API Explorer, obtain a token with permission user_online_presence, and type in the box:
fql?q=SELECT uid,online_presence FROM user WHERE uid = me()
I would really appreciate if anybody can help me with this. Thanks!