Web dev and programming discussions forums
Username
Forgot password?
Sign in with Twitter account
Sign in with Facebook account
Forum archives

Get Full Profile Pic using API? Or PID of profile pic? Help!


Hey, I figured out the way to get the proper PID (the type that will work with photo.Get API call) from a photo share url (using the pid and id URL parameters)

To make it easier to share and allow modifications, check my github gist: http://gist.github.com/327476

Essentially, perform a 32 bit left shift on the user id and then add to that the photo id. I have been (with ruby, at least) successful in producing a valid API call worthy PID by using this method. Makes it really easy to ask users for their photo share URL then automatically generating the API pid.

Fork the gist and add languages if ya want. Hope this helps people, let me know :)

View original thread with replies
Tags: pid, api, url, share

Get Full Profile Pic using API? Or PID of profile pic? Help!

Same problem,
To all photo from the profile albumm , I solved it like that , if it can help someone :

function getUserProfilPics() {
$facebook = new Facebook(APPAPIKEY, APPSECRET, GENERATE_SESSION_SECRET);
$fb_uid = $facebook->get_loggedin_user();

if ($fb_uid == false) { return array(null, 2, 'No valid FB user in Session'); }
$albums=$facebook->api_client->photos_getAlbums($fb_uid,NULL);
$aid_profile = null;
foreach($albums as $album){
if($album['type']=='profile'){
$aid_profile = $album['aid'];
break;
}
return null;
}
$photos_profile = null;
//It s a bit tricky but if you use also the uid like params then you will get a empty string ... Mistery
if(!empty($aid_profile))$photos_profile = $facebook->api_client->photos_get('',$aid_profile,'');
return $photos_profile;
}



you can test it in the tool box... it s works but it s not optimized...

link to the orignal picture in the array (key = src_big)


Make profile categories only editable by admins but still visible on profile pages

Hi there!

I would like to make a Category on my Drupal profiles only editable by Administrators or a particular role group. So users can't change them on their own. But I would like to make these profile category fields still visible on profile pages. Has anyone done this before, is this possible?

Thanks!
Brandon.


Bugs: Change Profile Picture & Thumbnail for Application's Profile

I have been having tons of trouble trying to change my Application's Profile Picture.

Uploading a new profile picture would not work using Chrome, Firefox, nor IE 8. I also cannot add new pictures to my Profile Picture Album

I FINALLY got my application's profile picture changed by adding the photos app to the page and making a new album, then setting a pic to the profile picture.

However, now I cannot change the Application's Thumbnail picture. Attempts at editing "Thumbnail Version" say it is saving, however a thumbnail never appears. My current thumbnail on the page is BLANK and I am frustrated at how broken this is. It's worse than MySpace's errors used to be.

Any help getting my thumbnail properly back?

The profile page is http://www.facebook.com/pnwbemani


SSL <fb:profile-pic> not delivering profile over https, mixed warning

I've just discovered something when experimenting, so this must be a bug.

When you set the following attribute in the tag facebook-logo="false" the profile image is served from httpS as you would expect. When facebook-logo="true" it comes from a http resource.

However, I do like the facebook logo on the profile pic. Can FB please fix this?

Thanks


SSL <fb:profile-pic> not delivering profile over https, mixed warning

Hi,

I sign users into my site with facebook connect over the ssl as detailed in this tutorial "Facebook Connect Via SSL" http://wiki.developers.facebook.com/ind … ct_Via_SSL

Everything works fine, except I am still getting mixed content message from the XFBML <fb:profile-pic> tag, even though the tutorial specifically says the picture should be delivered over https

QUOTE FROM TUTORIAL"
Querying Images with HTTPS Protocol
If you show user profile pictures on your site, then you'll need to make sure that you are showing them in HTTPS on pages that are also served from HTTPS.

The easy way to do this is to use the fb:profile-pic tag from XFBML. That will make sure that you are serving resources in the correct version.
"

The profile image is coming from this resource. http://external.ak.fbcdn.net/safe_image … pg&v=5

This is clearly not https, hence the mixed content warnings.

Does anyone know if this is working as specified?

Thank you.

I CALL IT LIKE THIS "<fb:profile-pic uid="loggedinuser" size="square" facebook-logo="true"></fb:profile-pic>"


Profile tab application slow after adding to profile tab

I just removed the code to allow adding it to a profile page and the runtime is back down to 0.0137 seconds.

I was using the sample code from the stickied thread here on adding a profile tab, and added it to my canvas page. Doh. I'll just have to move that out to a function or something since the client library is so slow.


HELP! Can't get add to profile button and profile information to show

Ok thanks for your response.
So Facebook is removing the boxes in favor of application tabs right? I'd prefer an application tab anyway. So far, I have successfully created a tab for my app, and someone can find it if they click on the plus sign tab and do a search (if they've used the app on the canvas page)... but my main need is to create an 'add to profile' button on my canvas page.

I know how to put a button on the page, I just don't know what 'add to profile' should do if the profile boxes are going away. Obviously I'd like to be able to create an app tab from an add to profile button. Is this possible?


HELP! Can't get add to profile button and profile information to show

Yes, profile boxes will go way. Profile tabs will remain.

Not yet, but soon. They will be introducing some sort of "add to profile tab" button in the next little while (details have not been posted).


HELP! Can't get add to profile button and profile information to show

Hi Everyone
Newbie here. Just learning php too. I look through some of the posts and tried some things but still can't figure stuff out. I've seen a lot of examples of stuff like this:
$fbml = "<fb:narrow>Here is some text</fb:narrow>

But when I tried putting in stuff other than text (like html and/or fbml) it doesn't work. Here's what I've tried:

<?PHP

// Application: My App Name
// File: 'index.php'

require_once 'facebook.php';
?>
<?php include('app_nav.php'); ?> // For my tabs to show up
<?
$api_key = 'XXXXX'; $secret = 'XXXXX';
$urlNarrow= "http://www.mydomain.com/myapp/fb_narrow.php";
$urlWide= "http://www.mydomain.com/myapp/fb_narrow.php";

$fbml = "<fb:wide><fb:ref url='$urlWide'/></fb:wide>";
$fbml .= "<fb:narrow><fb:ref url='$urlNarrow'/></fb:narrow>";

$fbml_main = "This is the Wall tab profile data";
$facebook->api_client->profile_setFBML($api_key, $user_id, "$fbml", NULL, NULL, 'profile_main');

// Other html stuff Here

<fb:add-section-button section=\"profile\" /> // My button
?>



I keep getting errors, and am pretty much clueless after trying different things. I'd appreciate it if you respond if you could keep in mind I'm a newbie to Facebook Apps and PHP.

Thanks in advance


HELP! Can't get add to profile button and profile information to show

You don't seem to be creating the facebook object before using it, or authorizing. Add this before the $facebook line:
$facebook = new Facebook($api_key, $secret);
$facebook->require_login();

Note that what you're developing won't work much longer, since Facebook is removing support. http://wiki.developers.facebook.com/ind … er_Roadmap


Profile tab application slow after adding to profile tab

My app ran in canvas mode in a fraction of a second server time before adding code to allow a profile tab. Now server side execution time is over 10 seconds. Is that normal? I'm using the PHP library and php 5.2.10.

Any help anyone can offer will be greatly appreciated.


Re: [invalid.profile.access]. You don't have access to the profile - URGENT

Lucian,

Thanks for your response.

So you mean that I need to send 2 headers. 1 will be with the signatures that I build and the other will be with the tokens that I have with me...

If the second option of sending the tokens as separate headers, then do you know how will I do that in CURL request in PHP.. ???


Let me know whether am I right ?

Thanks & Regards,

Muthukumar


Re: [invalid.profile.access]. You don't have access to the profile - URGENT

I think the problem is in how you are handling the x-li-auth-token header. This should be a separate HTTP header and should not be part of the signature. Take a look at this doc for more specific information: Accessing Out of Network Profiles


Re: [invalid.profile.access]. You don't have access to the profile - URGENT

Hi,

I am waiting for your reply. For your information I am giving you more details about the header that I send while the request is sent to LinkedIn for profile api


URL:

http://api.linkedin.com/v1/people/id=admR4kuLqI:(id,first-name,last-name,headline,location,industry,distance,relation-to-viewer,current-status,current-status-timestamp,summary,specialties,proposal-comments,associations,honors,positions,educations,three-current-positions,three-past-positions,member-url-resources,num-recommenders,picture-url,site-standard-profile-request,api-standard-profile-request,public-profile-url)

HEADERS:

1st TRY

Authorization: OAuth realm="https%3A%2F%2Fapi.linkedin.com",oauth_version="1.0",oauth_nonce="b9e150283441b074565ecb8cc79d4086",oauth_timestamp="1267599006",oauth_consumer_key="9D8m8tSUxbSu01wpwN4m2LuIpn5epc6jyDuzUO5V5JDSts5nwdKwUf39j_qOgShz",oauth_token="0d679813-d3af-4f7b-80e5-a12af42065b9",oauth_signature_method="HMAC-SHA1",oauth_signature="JnxdWLz7AjgSlcqX%2B%2FmetIFtGpo%3D",x-li-auth-token:OUT_OF_NETWORK:ZRh1

>>> NO ENCODING urlencode_rfc3986

2nd TRY

Authorization: OAuth realm="https%3A%2F%2Fapi.linkedin.com",oauth_version="1.0",oauth_nonce="fbed976778085ef0461f61faeee494bd",oauth_timestamp="1267599236",oauth_consumer_key="9D8m8tSUxbSu01wpwN4m2LuIpn5epc6jyDuzUO5V5JDSts5nwdKwUf39j_qOgShz",oauth_token="0d679813-d3af-4f7b-80e5-a12af42065b9",oauth_signature_method="HMAC-SHA1",oauth_signature="r%2FF1uI9OKUeHG6%2F7pCjqGf66Wco%3D",x-li-auth-token="OUT_OF_NETWORK%3AZRh1"

>>> ENCODING urlencode_rfc3986 with = in between name and value pair

3rd TRY

Authorization: OAuth realm="https%3A%2F%2Fapi.linkedin.com",oauth_version="1.0",oauth_nonce="e2633659f644c44e7366d923e61406ee",oauth_timestamp="1267599309",oauth_consumer_key="nZINpmgV3jzk8hjOOKrSsE6s0ounZC8YVBWFnHhTyohnyy-0Y4riH-ek90SjeZ3f",oauth_token="304c3d32-9c5a-40f9-8ed9-b6b89d40f684",oauth_signature_method="HMAC-SHA1",oauth_signature="wQ8nSnJe2Ahz4lxt2lnpZS2E%2FG8%3D",x-li-auth-token:"OUT_OF_NETWORK%3AZRh1"

>>> ENCODING urlencode_rfc3986 with : in between name and value pair

Response:

401 1267599042448 0000 [invalid.profile.access]. You don't have access to the profile

Please let me know what is the problem with the headers that I have set so that I am able to get response from LinkedIn with all the details about the person. i am able to get response with the complete details about the person if that person is in my network or in group.

Let me know your reply as early as possible.. Please its urgent...

Thanks & Regards,

Muthukumar


Re: [invalid.profile.access]. You don't have access to the profile - URGENT

Lucian,

Nothing seems to be working for me when I send request with multiple headers that I create. Please help me to get a proper request that can be send which gives me no error.

The following is the curl request that I send to LinkedIn.

curl_setopt($curl, CURLOPT_HTTPHEADER, array($auth_header, "x-li-auth-token=>OUT_OF_NETWORK:6QcL"));

$auth_header = Authorization: OAuth realm="https%3A%2F%2Fapi.linkedin.com",oauth_version="1.0",oauth_nonce="59015cd75ad39af165ebb54adffab998",oauth_timestamp="1267678093",oauth_consumer_key="nZINpmgV3jzk8hjOOKrSsE6s0ounZC8YVBWFnHhTyohnyy-0Y4riH-ek90SjeZ3f",oauth_token="304c3d32-9c5a-40f9-8ed9-b6b89d40f684",oauth_signature_method="HMAC-SHA1",oauth_signature="1YXphMg7XpzBRr90eKYVqjSjAg0%3D"

URL:

http://api.linkedin.com/v1/people/id=************:(id,first-name,last-name,headline,location,industry,distance,relation-to-viewer,current-status,current-status-timestamp,summary,specialties,proposal-comments,associations,honors,positions,educations,three-current-positions,three-past-positions,member-url-resources,num-recommenders,picture-url,site-standard-profile-request,api-standard-profile-request,public-profile-url)

Please check the curl request that I send as well...

$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_HTTPHEADER, array($auth_header, "x-li-auth-token=>OUT_OF_NETWORK:6QcL")); // Set the headers.

$data = curl_exec($curl);

Please anyone who knows how to send multiple headers in php curl, please help me out to let me know how can we do so, this will help me to get the profile of people who are there out of network...

Please help me and let me know since I have never sent multiple headers in as a curl request...

Awaiting for a reply from anyone, please revert.

Thanks & Regards,

Muthukumar


RE: Invalid ICC Profile
Jan 25, 2010
Many thanks Pete FOP 0.93 was the stable release when this project was implemented. We will not go to a newer version until there is a specific bug fix or enhancement that would be required. The Invalid ICC Profile was caused by a user who...

Re: Permanent Profile URL
Feb 23, 2010
* Lil Peck <lilp### @gmail.com> [100223 10:48]: > On Mon, Feb 22, 2010 at 11:10 PM, Paul Tarjan <pta### @gmail.com> wrote: > > Is there a permanent profile URL for users? Something like > > > >...

sfDoctrineGuard and more than one Profile
Jan 31, 2010
Hi every: I'm building a application based on Symfony and sfDoctrineGuard. The ER design of the DB have a lot of tables asociated to sf_guard_users table so exists more than one table storing profiles fields. Wich are the better ways to deal...

Re: Invalid ICC Profile
Jan 22, 2010
Hi Stuart, It might be that you have an Invalid ICC profile :-) but it would be hard for us to confirm this without taking a look at the input you supplied to fop 0.93. If you do not want to post the input , please provide another example that...

Re: Permanent Profile URL
Feb 23, 2010
> You could make a custom TinyURL. > Or you could buy a domain name and have it forward to your Twitter profile.

Permanent Profile URL
Feb 22, 2010
Is there a permanent profile URL for users? Something like http://twitter.com/account/profile?user_id=14757201 I'd like something that is ID based (since users can change their short form) but is guaranteed to resolve for a while. Possibly even...

How to get Viewer profile UID and Firstname
Feb 24, 2010
HI I understood the Opensocial API, @ this link below. http://code.google.com/p/opensocial-java-client/wiki/TwoLeggedOAuthJava I understood how we can get a persons uid profile name and details regarding his/her friends. But , I am developing an...

Profile avatars with AWS S3 versioning
Feb 12, 2010
Now that Amazon S3 supports versioning couldn't profile avatars use static URLs and let browsers handle the caching with ETags? More info on S3 Versioning: http://goo.gl/CMch Abraham

Re: background url showing via api, but not on profile
Feb 9, 2010
I think you are right about these issues. The third one you mentioned I think should be fixed in the API: - uploading a new background image via the API does not cause the image to be displayed I just filed this ticket:...

Re: Build profile parameter
Feb 4, 2010
This is a multi-part message in MIME format. This is a multi-part message in MIME format. you should already have access to all the command line args. if you have a profile like this, the params are recognized: dependencies = { action:...