How do i get someones profile picture to display back to them? - facebook

How do i get someones profile picture to diplay back to me. I have already gotten permissions to use the user's pictures etc i just don't know how to use their profile picture and display it back to them.
Any help would be awesome

Calling on the Graph API
http://graph.facebook.com/[id]/picture
The following will give you different sizes
http://graph.facebook.com/[id]/picture?type=square
http://graph.facebook.com/[id]/picture?type=normal
http://graph.facebook.com/[id]/picture?type=large
So you can just put these URLs straight in an <img> tag
EG: <img src="http://graph.facebook.com/4/picture?type=square" />
See:
http://developers.facebook.com/docs/reference/api/#pictures
These are in the public domain, so there is no need for any authentication.

Related

Retrieve Facebook full name and picture from profile url

I'm trying to make a website with text input for facebook profile url and after procceeding, there should be user's name and profile image shown.
I saw something like that here: http://hackfbaccountlive.com/hack_account.php
(No, I'm not making another fb hack.)
I have been trying for a couple of hours now, and I always need to log in, and it's not working as I want.
Can you help me?
You should go into detail about what you're trying to do, as it sounds suspicious (please do not create a hack site). That being said, this all public information that can be fetched with the following calls:
https://graph.facebook.com/[user_id]
https://graph.facebook.com/[user_id]/picture
https://graph.facebook.com/[profile_username]
https://graph.facebook.com/[profile_username]/picture
You can then use either the UID or the profile username to create the profile URL, which is just https://www.facebook.com/[username_or_id]

Multiple Facebook share button/link on the same page refering different TITLE & LINK

I need to create a "contest" page where user will be asked to submit picture.
After that, they should be able to share their picture on FB, Twitter, G+, Pinterest, etc for other people to come and vote.
I want the page to be displayed as a jQuery gallery and whenever people select a thumbnail, the bigger picture open with the associated vote and "share" button.
When a user share an image, I want a specific TITLE & URL associated with that particular image... something like "http://www.mysite.com/contest.html#picture1"... or "http://www.mysite.com/contest.html#picture2"
How is this possible if I only have one page?
I wouldn't have problem if I could use the old "facebook.com/sharer.php" with parameters... but it seems that the Open Graph Protocol is "overiding" the sharer.php parameters....
Works fine with Twitter and Pinterest... I might have the same problem with Google+.
Excuse my bad english, thanks!
Well, set up a (“dummy”) page for each picture, and fill it with the appropriate OG tags … and have your users like that. And then put a JS redirect into that page, so that users following the link when it’s shared on Facebook will get to the “real” address you want them to end up at.
(Btw., IMHO this is what happens too often these days when people think doing everything client-side and client-side only is so “fancy” and that a “good” and “modern” site requires all that AJAX/one-page-only nonsense instead of a real good and working URL structure, and then are not able to handle all that this implies properly …)

Need Advice: Facebook Like Button to like a subsite

i'm struggling around for days now ...this is the scenario:
a user can upload a pic and add some text on the site. After that, he/she gets a link that leads to his created content. I want the user not only to share his content with the link, but also on facebook with specified image and text. Tried this with open graph tags, but it is bad changing those tags dynamicly before liking because fb caches that info and does not recognize specific changes ... but correct me if i'm wrong ...
The problem seems to be, that when the user clicks on the like button, the content to share is not the actual site, but the subsite with its content ...
How would you do this?
Thanks for any advice!
I think you are looking for something like this:
facebook like: href url vs. canonical url
doing it with the fbjs sdk was the right hint ... now it works perfektly and individual ...

how to store facebook profile pic in database?

as we know that to get a profile picture we use this url (graph.facebook.com/1700278611/picture)
but when i want to store it in database it is not working can anybody tell me how to save that image in database as we know this url (graph.facebook.com/1700278611/picture)
redirect to this url (http://profile.ak.fbcdn.net/hprofile-ak-snc4/hs222.ash2/48814_1700278611_949486_q.jpg) so pls help thanks in advance
You can just store img_url as graph.facebook.com/FB_USER_ID/picture in database. In your webpages, you can simply use that URL like <img src="http://graph.facebook.com/FB_USER_ID/picture" /> to display the image.
You do not really need to know the "real" image URL. In-fact, that may eventually get defunct if user delets or changes his profile image. So, real image URL may not be advantageous. On the other hand, the symbolic URL provided by graph API will always point to the latest user image.

Limiting the number of thumbnails on facebook share

So I want users to be able to share this link on facebook but I want only a specific picture to be the thumbnail for this sharing picture and no other images that appear on my web site
I read the documentation about facebook share and I got this
http://developers.facebook.com/docs/share
Basically what I understand is that
<link rel="image_src" href="thumbnail_image" / >
should do what I want. However, I cannot get this to work. My site is programmed using rails and, inside the layout, I have the above tag to take in an image url coming from a model instance.
Does anyone know how to use this properly? Am I misunderstanding something about this tag? I want to disable user from selecting through the images that I have on my page and just allow the user to share with only 1 image which I have to specify.
To specify a specific picture you will need to add open graph meta tags to your page. Take a look at http://developers.facebook.com/docs/opengraph/.
The open graph tag for your case is: og:image