Get any user_id from Facebook url - php

Can I get any user id from facebook url with PHP language?
Facebook graph api not allow get any user info. Is there another way to get info without access_token?

You cannot get any Facebook's User data using the Facebook API without the User's explicit permission. The permission is granted to you (your APP) by the user in a popup window stating exactly what information you are receiving and with which permission type (read, write etc..)
This is all for good reasons.

Related

Get user infos from facebook Profile URL

Good morning all,
I must create a site in PHP where we enter the url of the facebook profile, and then it must retrieve some information from the profile:
The profile picture
The name
If the profile and verify
I wish I could do it without this connection.
What to give me a clue?
(I succeeded with tiktok, instagram, etc.) but with facebook it's been a while that I'm looking for the solution
This is not possible for 2 reasons:
Scraping is not allowed on Facebook, you must use the API for accessing any data
Any user data is unavailable with the API, unless the user authorizes your App to access his data
The correct way to implement verification is to implement login with the Graph API and let the user authorize your App. Btw, this still does not mean you can verify his profile url, because you will not get the real URL, not even with authorization.

Post offline/without login using Facebook SDK PHP

I need implement a functionality in save/update function, of my customers system:
In each save/update, I need get this informations, and send to a Facebook Page (every the same Page).
But my problem is: this system is used by a lot users, and some users do not have a Facebook account, so: How can I post in same Page without login?
I know the offline_access are removed, so, what the best solution in this situation?
I don't find any way, to get the Page Access Token
I create some APP in my personal account of Facebook, but, when I try post in this Page, I get a access unauthorized for this user/app
Sorry for my english.
For you to post updates on to the Page's feed there are few things you would require
An User with administrative or content publishing permission to atuhorize your application with manage_pages Extended permissions. If you have implemented the login, you can add these permissions there, or alternatively you can use Graph Explorer with your application selected to get started.
After you have been authorized then you can retrieve the Page Access Token by querying /me/accounts which would return data as shown in this documentation. You can then utilize the access token you retrieve for the corresponding page to do your job of posting updates.

like and comments on post of page/profile outside facebook

Writing details for everyone to understand it well -
I created a facebook application to generate a access token by that application id and secret key
I used that access token to get wall posts of ANY facebook page or profile or group using Graph API in my php website which is my aim
Now i want that any user can like or comment on a post of "facebook page wall posts" in my site which i showed in my site by graph api in section 2 above
I can comment on a post or like a post using Graph API call using my access token(with "publish_stream" permission) but if i try same for another user(logged in to fb) with my that access token then its not working.so it means i have to generate another access token for that user with "publish_stream" permission.Is that the way i have to do??
why i don't want it that if i write code to generate a access token with "publish_stream" permission for any user without "permission dialog of application" to let user know that they giving that permission then it may have a big security lick if hacker gets my code, he can do anything with that access token, he can even delete all user profile posts!!!! or posts!!!!! anything on behalf of user.
so what is the best way to do comment,like on a post of any page/profile/group outside of fb(i will use ajax call for that in website outside of facebook)....
footnote: my client want it too..so seriously want to do it.

Facebook user id on iframe page tab without permissions

I have a fair amount of Facebook development experience, but this had made me pull my hair. It must be something very small, but I can't get it. I recently saw some Facebook pages with welcome tabs that show user's name "Welcome [YOUR NAME]" who visits their page. Example is here:
https://www.facebook.com/Tony.Samaha.Official.Page
As per my knowledge, we cannot get the user id without the permissions by the user. After the permissions we are able to get the user id in the signed request. How do I get the Facebook user id or name, something similar to the above example? How is this working? Can this be achieved?
FYI: I am using iframe tab.
Check out the documentation on signed_requests. When a user visits your application there will be a signed_request posted to your URL. The documentation states :
A signed_request is passed to Apps on Facebook.com when they are
loaded into the Facebook environment
A signed_request is passed to any
app that has registered an Deauthorized Callback in the Developer App
whenever a given user removes the app using the App Dashboard
A signed_request is passed to apps that use the Registration Plugin
whenever a user successfully registers with their app
You will have to decode this request (see the link above for details) and from there you will be able to extract the user_id of the visiting user. Then all you have to do is query the Graph API like this :
https://graph.facebook.com/USER_ID and you will get back the public information for that user which should include the users name.
The user is still using the old static FBML application, so most likely they are using the fb:name tag. Though, I believe this is now deprecated. So really, the page you linked to needs to be updated.

Google Friendconnect: How to fetch profile data when the user id is known

I am integrating GFC with my web app (PHP). In this app I have a list of user IDs and I need to fetch their profile details like their display name, profile pic url etc. using a HTTP call.
For example, I am trying to fetch data of user with id: $userId = 1234567
If a viewer (need not the user with above id) is logged in, I am able to fetch data by making a call to following URL.
http://www.google.com/friendconnect/api/people/$userId/#self?fcauth=$fcauth
But, if viewer is not logged in, the above URL replies the following
Anonymous requests are not allowed to fetch data
Error 401
I would like to know what URL should be used to fetch the user data even if no one is logged in.
Thanks!!
The fcauth mechanism is designed for access while the user is online. The fcauth tokens expire fairly rapidly, and no guarantee is made about how long they're valid for. You should assume that they'll only work while the user is online.
If you need offline access, you need to use OAuth. OAuth tokens are valid until manually revoked.
The API call you're making is the correct one, you just need to do it with OAuth instead of fcauth.

Categories