web scraping - Extract facebook data from access token -


i'm trying use site https://www.oneall.com/ add social login test site. after setting code , login still don't know how extract user data access token. here's link get:

http://myaccount.api.oneall.com/socialize/redirect.html?provider_connection_token=access token here

i code call page

if ( ! empty ($_post['connection_token'])) { echo "connection token received: ".$_post['connection_token']; } else { echo "no connection token received"; } if ( ! empty ($_post['connection_token'])) { $token = $_post['connection_token']; $site_subdomain = 'myaccountname'; $site_public_key = 'public key'; $site_private_key = 'private key'; $site_domain = $site_subdomain.'.api.oneall.com'; $resource_uri = 'https://'.$site_domain.'/connections/'.$token .'.json'; $curl = curl_init(); curl_setopt($curl, curlopt_url, $resource_uri); curl_setopt($curl, curlopt_header, 0); curl_setopt($curl, curlopt_userpwd, $site_public_key . ":" . $site_private_key); curl_setopt($curl, curlopt_timeout, 15); curl_setopt($curl, curlopt_verbose, 0); curl_setopt($curl, curlopt_returntransfer, 1); curl_setopt($curl, curlopt_ssl_verifypeer, 1); curl_setopt($curl, curlopt_failonerror, 0);  $result_json = curl_exec($curl); if ($result_json === false) { echo 'curl error: ' . curl_error($curl). '<br />'; echo 'curl info: ' . curl_getinfo($curl). '<br />'; curl_close($curl); } else { curl_close($curl); $json = json_decode ($result_json);  $data = $json->response->result->data;  if ($data->plugin->key == 'social_login') {   if ($data->plugin->data->status == 'success')   {     $user_token = $data->user->user_token;      $user_id = getuseridforusertoken($user_token);      if ($user_id === null)     {       linkusertokentouserid ($user_token, $user_id);     }     else     {     }      }    }   } } 

i need learn how extract data , little example extracting user name code.

you can use access token connection details oneall using api

you use connection_token connection details (including user's facebook profile data).

example http://myaccount.api.oneall.com/connections/access token here.json -->>for json formatted data

oneall docs


Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -