Collecting facebook user-id from website visitors [duplicate] - facebook

This question already has an answer here:
Get Facebook User Id of my website visitors w/o auth
(1 answer)
Closed 4 years ago.
Is there any way to take the facebook user-id of a website visitor and save the user-id to a text file to keep track of visitors. I know there is some ways using Facebooks API, but it seems like the user have to give permission, and that is not what we want. So any way to save the facebook user-id of a website visitor without any user interaction?

Simply put: you can't. This would be a huge privacy/security issue IMO. You need explicit permission from the user to get his ID on your own website.

Related

Automatic 'like' after logging in via Facebook [duplicate]

This question already has an answer here:
How can I use the Facebook Javascript API to automatically make a user like a page?
(1 answer)
Closed 9 years ago.
I've been googling for days. I have a read a lot of documentation, forums etc, but I haven't found a working solution.
I am trying to add 'like' to the page https://www.facebook.com/Superawesometest on behalf of the user after he/she has logged in via facebook. I recieve all the necessarry permissions and an access_token.
but using $facebook->api("/Superawesometest/likes", 'post'); wouldn't work
what am I doing wrong?
Try using the Superawesometest page's Page ID instead of the name "Superawesometest" in the API path

Connect to only my Facebook account and show my photos on my Website [duplicate]

This question already has answers here:
How to display my photo albums and photos that are in FB on my own website
(6 answers)
Closed 9 years ago.
I'm trying to show my albums from Facebook on my website using Graph API or FQL, but all the examples I find are to access the photo albums of my visitors.
Can anyone guide me in how to connect to my Facebook account and check my albums for visitors to my site to see my photos?
I am not going to feed you the codes, but what you should do is, run the Oauth script at backend where user has no access to, get the accesstoken which is then used for the main site to fetch the required details.
It is inshort hardcoding (or accessing from a db/file) the access_token instead of generating it by authorizing the visitor which shows their details.
Once you have the image links, you only have to update the new ones. You should code the site such a way to avoid unwanted queries.

Can a facebook app publish on behalf of a facebook page? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Post on a Facebook wall as Page, not as user
Can facebook apps publish on behalf of pages like they do with user statuses?
You most certainly can! Just be sure to use the appropriate access_token. You'll need to authenticate as a page to get this. The documentation explains it best but basically, the administrator of the page must first grant the application the manage_pages permission, once you have this permission, your application will be able to make an API call to /me/accounts to get a list of all the pages that user administers and their appropriate access tokens.
With your shiny new page access token, making calls to the API is just the same as it would be for a user -
https://graph.facebook.com/PAGE_ID/feed?access_token=PAGE_ACCESS_TOKEN&message=Hello Page World!
As effective from October 3, Facebook has changed some rules because of many "spamming" apps, phasing out some of previous privilages. Currently there are very limited resources/tutorials explaining this in detail but better you can check facebook API.
https://developers.facebook.com/roadmap/completed-changes/
https://developers.facebook.com/blog/post/2012/07/05/platform-updates--operation-developer-love/

How do I retrieve the list of people who liked my Facebook page? [duplicate]

This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Retrieve Facebook Fan Names
How to list facebook users who like a page or interest
in my project i want to retrieve the list of persons who have liked facebook my page. I want to get the user details and their uids.
A user may Like the page and once again he likes the page using a duplicate profile, so to avoid this type of things i want to get the uid of the person who like the page.
Is there any Api available for this...
Is it possible to get the uid value using the batch request Api
Is there any other way to get the uids of the user, please help me friends..
Simple use this.
https://www.facebook.com/browse/?type=page_fans&page_id=your page id
It will return up to 500 of the most recent likes. Happy coding!
The only way you can get the ID of such users is to have an app running as a page tab. When the user loads your tab, and installs (i.e. gives permissions to) your app, the signed_request that Facebook sends to your server (along with the HTTP POST request for the page) will contain a user_id.
tl;dr: you won't get any IDs unless users install an app you made.

How to access Facebook from a Playframework service [duplicate]

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Library to Integrate Facebook login with Play Framework?
I use playframework to make Json/Rest services - no webinterface.
I want to make a service, which posts a message on a Facebook wall.
I had a look at fbconnect and fbgraph, but they seem to only support webinterface.
Am I right ?
Of course, I can just access the Facebook graph API directly, but I would like to know if there are better ways. Later I want to do a lot more with the graph api.
If you want to post to any user's wall you will need the OAuth dialog in order to FB grant access to your app on the user's wall, at least for the first time.
If you are posting to your system's wall then you can get the access token's for your application and store it somewhere.