how to show facebook and twitter user profile image on my website's comments - facebook

I am showing Gravatar's Avatar on my webpage comments
like that
$hash = md5(trim($row['email']));
$default_usr = urlencode('http://localhost/example/images/user-icon.jpg');
src=\"http://www.gravatar.com/avatar/$hash.'.jpg?s=45&d=$default_usr'\"
but i want that as avatar's when someone post a comment on my website using an email
which belong to its facebook account or twitter account his/her 's image shows on my website's comments too.
But i don't know how?
Any Facebook Lover or twitter lover who can help me Please Please.
I do not want to use facebook app i am developing my own comment widget using php where i want to use it

http://graph.facebook.com/paul.knox.anthony/picture
will get you the profile picture of a user from the Facebook graph API. file_get_contents() with PHP should allow you to grab that. However, it looks like you only have the email address of the user. In that case, you'll need authorisation from Facebook to get the user from just an email address.
See: Is there a way to get an user's email ID after verifying his/her Twitter identity using OAuth?
Facebook API - How do I get a Facebook user's profile image through the Facebook API (without requiring the user to "Allow" the application)
You are most likely going to have to do some OAuth stuff.

Related

Is there API to get someone's facebook profile with out login to facebook?

I was wondering if its possible to get one's facebook profile (to be exact,'profile url') through their API?
I need an api to get fb profile link using a matching email address. I dont want to login to facebook though.I was trying to search for this but it seems you need to log in to facebook to get that.
Any idea or is it feasible?
You need ID of the concerned user which can't be achieved without using the Facebook Login, since Facebook login is the starting point to get the current user info (/me).
Search API could have helped you since you have the email ids of users, but unfortunately this api doesn't support user search with email!
So, answer is simple- NO, you cannot get the ID (profile link) of the user without using the facebook login.
Not that I can think of. Facebook's Graph API gives you some public info but that info given depends on the users Facebook's settings on what is public or not. You could maybe get some users profile picture but not others, making it not a very viable option for practical use. Hope that helps

Can you use Facebook Graph API to post a photo to a brand account as well as user account?

I am working on a project where a photo is taken and the user can share their photo on Facebook. We would use oAuth and the FB Graph API to post the photo and caption to the users' timeline. The client just made a request to also post it to their (the client's) photo album as well. So when the user submits a photo, it would post to the user's timeline as well as the client's timeline/album. Is this double post (to two different accounts) possible? Wouldn't that require that the client be logged in via oAuth as well? Also, are there any FB legal/regulation issues with this so long as the application has a disclaimer that it will be posted to two different places?
The entry for the user is a new photo to the apps album for that user. me/photos
However the entry that goes to your clients page... I don't think people can do id/photos of others or pages. (it's worth a shot)
You'll have to stick to id/feed and perhaps include a link to an image host.

Which app do I need to display facebook feed?

I need to display the "wall posts" from Facebook page to another website's social media wall.
The problem is that I never used neither Facebook nor any other social networks and got no clues on how do they work. That's why I'm pretty confused with API and it's terms.
The API docs say that I need a pageId for the page I'd like to display and appId and appSecret to get an access token to the feed.
I understand how to get the token and how to parse the results - but what kind of Application do I need for that? Should I create a facebook profile and make an application that would generate me these app codes? Or ask a page's owner to do it?
I spent quite a time googling but it must be something too obvious to write about it in docs? Help please?
The administrator of the facebook page is the only one that has access to the posts on the page wall.
For the APP:
The application can be created in any facebook verified account - go to: https://developers.facebook.com/apps and create the new app - this will give you the app id and secret.
Use the Facebook SDK that you feel most comfortable with to develop the app.
For the wall posts: There are several Graph API requests for wall posts in the form of:
https://graph.facebook.com/[pageid]/[call] where [call] can be posts, statuses, feed, home. See http://facebook.stackoverflow.com/questions/6214535/what-is-the-difference-between-feed-posts-and-statuses-in-facebook-graph-api for details about each.
Using an access token (that you said you already know how to get) the administrator of the page will be able to call the above URLs and get the wall posts.
For the part with posting the info on another social media website you have to specify the exact environment where you want the wall posts to end up.

Login with facebook and storing important user information

The facebook "wave" has finally hit me and I see that it's now time to integrate the wonders of the Facebook API into my site. I'm a little worried about implementing a "Login with Facebook" button because my site stores information about each user, and I'm not sure whether or not the facebook login system will also store said information. Any user who registers to my site has the ability to "like" certain pages that were found while browsing the site, and the categories of each page the user likes is stored and linked to his username.
If the user were to "login with facebook" however, and thus skip my registration page, would the information about categories still be saved?
Even looking at StackOverflow.com, I notice that all of my profile information etc. is being saved, but where? I used the login with facebook button so where exactly is my profile information being saved?
When you login with Facebook your site gets a Facebook ID and some other information (depending on what you ask for, but normally first name, last name, email address). You can then use the Facebook ID or email address to link it to an existing account in your system. If you can't find it, automatically create a new account with the details provided from Facebook.
You can use the Registration Social Plugin that facebook offer in order to get the data you need from the user while they register to your site using their facebook profile.
Also, as #JonGrant wrote, you can just use the api to get the needed information from facebook, just take into consideration that the more permissions you ask for, the less users will authorize your app.
Edit: Plugin now out of date, please refer to Facebook Login.
This was plugin removed as of API version 2.0. It will stop working
on July 30, 2015. Apps using this plugin should migrate to Facebook Login.
Source: facebook docs

Get users twitter id?

Can anyone tell me if there are any fields in the FB Graph that list a users twitter ID if they've linked it to Facebook.
No, there's no place in a Facebook profile to provide that information, and no way to retrieve it either - you'd have to get your user to log in to both Facebook and Twitter using their respective APIs