The first URL provides HTTP 302 (temporary redirect) to the second. So, to find the second URL programmatically, you can send an HTTP request for the first URL and get the Location header of the response.
However, do not rely on the second URL being pemanent. Read the HTTP response code a bit (302 as opposed to the constant 301), it is possible that Facebook changes these URLs on a regular basis so that people cannot, for example, use their servers to host images.
Edit: Please note that the CDN URL published by the OP is now 404, so we know that we cannot rely on the durability of the URL. In addition, if you are connecting to the Graph API with <img> on an SSL-protected page, there is a parameter there , you must add make sure that you are using http s ://graph.facebook.com .
Update: API added parameter - redirect=false - which leads to return JSON, and not to redirect. The recovered JSON includes the CDN URL:
{ "data": { "url": "http://profile.ak.fbcdn.net/...", "is_silhouette": false } }
Again, I would not rely on this CDN URL, which is durable. The JSON response is sent with permissive CORS headers, so you can do this client side with XHR requests.
josh3736 Jul 27 '10 at 8:10 2010-07-27 08:10
source share