This might be an easy question, but I'd like your help with this. I couldn't find a solution on stackoverflow neither with google, probably cause I don't know what to search.
I'm using the facebook API for some purposes. Users who are visiting the page, need to login with facebook and give standard access to there profile. The only thing I store at the moment is there facebookid.
The issue:
On this page I need the amount of friends (just the countnumber) from the last users who visited the page. (for some purposes) To bad the friends are not publicly accessible.
What's the best solution to retrieve this?
Storing the access token (is this still possible in a way?) and get friends with graph.facebook.com/-id-/friends?access_token=...
Is there another way to get count of friends?
I'd rather not save the amount of friends in the db, cause this is not accurate.
Thanks in advance!
You need to collect offline_access extended permission. And then to access other friend data, please cllect the friend_* extended permissions listed in the following SO url
Facebook Graph API - get friends info
Hope it will help.
Related
I need to read facebook timeline but I don't know how I can do. I don't find anything!! I use this library:
https://github.com/facebookarchive/facebook-php-sdk
Anyone can help me to suggest a tutorial or other something?
Here you can access the FB Developer pages.
They have examples and manuals for a variety of programming languages and tools.
Here's a few things you will need in order to read an FB timeline:
Facebook assigns a unique and fairly long ID to any account, whether profile or fan page. Users, however, don’t use this ID to identify pages. So the first thing to do in order to read a timeline is match the public name of the page (or user) to the underlying Facebook ID.
Getting the ID of the account for which you intend to read the timeline is only the first step. You also need to be authenticated to access the feed.
Once acquired, the access token can be saved to a cookie and used for every further operation until it expires.
You can find the whole article on this link.
There are a few code examples on the page as well written in C#.
Hope this helps.
I need to be able to consolidate all the likes from users that use my Facebook app into an Excel or .csv file. I can have the user authenticate within my Facebook app, but is there a way to see the likes for all users of an app using Open Graph or some other Facebook tool? I'm certain that someone else must have had this problem, and I'm hoping that one of you can help me out!
I've been trying to run FQL queries to bring up likes, but don't have any experience with PHP so it has been miserable so far. Any ideas?
There's no way to retrieve a list of users of your app - you'll need to manually build that as users authorise the app see this question for more information
Assuming you have permission to access a user's likes connection - access /USER_ID/likes and parse the response, saving it to a file in accordance with whatever language you're using's syntax (google is your friend here)
Note that your use of the data is subject to Facebook's policies and user's consent in accordance with your privacy policy and sharing it with third parties may be illegal (i am not a lawyer, this is not official advice, etc etc)
Here is the problem with that the application type does not have a like connection. Application Object GraphAPI This is inconvenient when you are looking to gather data on the users that like it.
OR were you talking about the likes endpoint of the user object? That you can gather but I dont think it is what you are looking for. It is shown here Graph Explorer Example - user's likes
i have been googling since morning for an answer that meets what i need but with no luck.
i included a facebook like button to a website i am working on, but i was wondering that after a user presses the button,signs in and like the site, is there a way i can use to retrieve a list of this user's friends on facebook? and post something on their walls instantly? not just post the like on his wall.
Or if that wasn't possible, can i retrieve his friends into a csv file or something so i can later send them emails for example ? ..
what i have in mind is like how certain applications ask us for permission to access personal data in facebook and use them in thing releted to them. well same point ! so can this be done ? and if yes, how ??
if you find any links related to this or have previous experience in this domain please post an answer :)
for programming solutions, i use php, yet i am still a junior developer :).
thanx in advance
No, it isn't possible.
Bob liking you does not give you permission to spam all of Bob's friends.
No, you can't get the information you want with a simple Like button.
You would have to create an App, ask for permissions and get the user to agree.
Here is the list of permissions you can ask for.
To build your App, start here.
I hope someone wil be able to help to resolve my problem.
We can't say Facebook's forums are very useful for developers...
This is my problem.
On two different applications, I execute requests with Graph API.
For one of both, I make a friends request to invite user's friends to use application.
For the second application, I use Facebook Places to retrieve all informations about a location.
These two codes are simples functionnalities tests.
Before excute a request with Graph API, I ask to user to give me necessaries authorizations.
But results are, often, an empty JSON "data" array...
Before posting here, I search some solutions on internet.
Some people say application hasn't necessaries rights. Others user must like application page to retrieve informations correctly...
I tried these solutions... whithout concluant result.
For example, talking about my Facebook Place based application.
It asks user_checkins and friends_checkins rights.
Goal is to retrieve, for a given location, datas from users who're tagged there.
But I have an empty data array as return.
I tried my code in different ways, with PHP SDK, Javscript SDK and FQL. Same result.
Thanks :)
Sorry for my english. I'm a french developper ;)
For this - "Goal is to retrieve, for a given location, datas from users who're tagged there." Refer to https://developers.facebook.com/docs/reference/api/page/ and you will see that you can only get the checkin information for the current user or friend of the current user. In the case of a friend you will only get that information if the friend has allowed other apps to see this. So to test that you get data you should check in to a place (page), find the place's id, then make a query to https://graph.facebook.com/PAGE_ID/checkins with an access token that has user_checkins permission.
Also, here is a tool that you may find useful when debugging your API calls and permissions - https://developers.facebook.com/tools/explorer
So, if you sign in using facebook on my website, how much access do I have to your friends? I am asking this question because I want for example to know if a user asks me a question about his/her friend, I can go through their Facebook status messages for example and tell them the answer depending on parsing information but do I have access to the user's friends information or no? (And how can I do that if it is possible in another way)
Note that the Facebook API has recently changed (it's now the "Graph API"). As of now, you go to http://graph.facebook.com/username/friends after authenticating with OAuth. As always, there will be copious libraries to help.