faysalmirmd

Untitled

Nov 4th, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.24 KB | None | 0 0
  1. $jsonurl = 'https://graph.facebook.com/oauth/access_token?client_id='.$consumerKey.'&client_secret='.$consumerSecret.'&grant_type=fb_exchange_token&fb_exchange_token='.$post['accesstoken'];
  2.        
  3.        if (ini_get('allow_url_fopen')) {
  4.             $jsondata = @file_get_contents($jsonurl);
  5.        }else if(extension_loaded('curl')){
  6.             $ch = curl_init();
  7.             curl_setopt($ch, CURLOPT_URL, $jsonurl);
  8.             curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
  9.             curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  10.             curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // added by sabuj
  11.             $jsondata = curl_exec($ch);
  12.             curl_close($ch);
  13.        }else{
  14.            echo 'Server not congiured for \'Content Grabbing Technique';
  15.            return;
  16.        }
  17.        
  18.        //var_dump($post);
  19.        //$accesstoken        = explode('&',@file_get_contents('https://graph.facebook.com/oauth/access_token?client_id='.$consumerKey.'&client_secret='.$consumerSecret.'&grant_type=fb_exchange_token&fb_exchange_token='.$post['accesstoken']));
  20.        $accesstoken        = explode('&',$jsondata);
  21.        $accesstoken        = explode('access_token=',$accesstoken[0]);
  22.        $oauth->accesstoken = $accesstoken[1];
Advertisement
Add Comment
Please, Sign In to add comment