Access to full-size (851x315) chronological cover according to the api schedule

I notice that when I access the timeline cover URL via the Graph API (using PHP), the returned photo is 720x266 instead of 851x315. Either using <graph api url>/userId/?field=coveror accessing the URL in ['cover']['source']the json array returned when accessing<graph api url>/userID

I could not find a way to get a full-screen cover. Using firebug, I can see that Facebook uploads a full sized image of 851x315, the only difference in the url is that the one returned by the API has 720x720 in the way,

What Facebook uploads:

http://a3.sphotos.ak.fbcdn.net/hphotos-ak-prn1/xxxxxx_xxxxxxxxxxxxxxx_xxxxxxxxxx_n.jpg

What API Graph returns

http://a3.sphotos.ak.fbcdn.net/hphotos-ak-prn1/s720x720/xxxxxx_xxxxxxxxxxxxxxx_xxxxxxxxxx_n.jpg

Is there a way that I can directly access this url with full cap size? I could parse the URL returned by the API to split 720x720, but I hope this is a more elegant way to get the full cover URL for the photo directly.

+5
source share
3 answers

Access to full-size cover of facebook user framework


In php we can do the following. Its a little hack, and I can’t guarantee that it will work for life.

As you can see, there is a photograph in the return URL s720x720. Now we replace it with l720(L720). using preg_replace () in php.


$coverphoto_url="https://a3.sphotos.ak.fbcdn.net/hphotos-ak-prn1/s720x720/xxxxxx_xxxxxxxxxxxxxxx_xxxxxxxxxx_n.jpg";

$coverphoto_url = preg_replace('/s720/i','l720',$coverphoto_url);

It will return

https://a3.sphotos.ak.fbcdn.net/hphotos-ak-prn1/ l720x720/xxxxxx_xxxxxxxxxxxxxxx_xxxxxxxxxx_n.jpg


javascript.

coverphoto_url = coverphoto_url.replace(/s720/i, 'l720');

, coverphoto API- , , .

URL- Securl?

, - :)

+6

API- Facebook, JavaScript :

FB.api("/hawaiianchimp?fields=cover", function(response){
        FB.api("/"+response.cover.id, function(response){
            var img_src = response.images[0].source;
        });
      });

, API ,

+2

, URL- : .../c0.0.851.315/...

:

$url = "https://graph.facebook.com/{$id}?fields=cover";

// // this points it to the actual banner, not the fullsized one 
$key_851 = 'c0.0.851.315';

$response = json_decode( file_get_contents( $url ) );

if( is_object( $response ) && property_exists( $response->cover , 'source' ) ) {
    $coverphoto_url = preg_replace( '/s720(\w*\.*)\d*(?<!\/)/i', $key_851 ,$response->cover->source );
    echo $coverphoto_url;
}
+1
source

All Articles