This post will show how to get any user's data from google plus.use this code and replace XXXX with your profile id.
<?php
$headers = file_get_contents("https://www.googleapis.com/plus/v1/people/XXXXXXXXXX?key=AIzaSyCu5XuZLFpO6MLQesBHZyMHQYRuTHYK3ys");
//echo "<pre>";
//print_r($headers);
//echo "</pre>";
//echo '<img src="https://plus.google.com/s2/photos/profile/116018066779980863044?sz=100" width="100" height="100">'
$json=json_decode($headers);
//echo 'NickName:'.$json->nickname."<br/>";
echo 'Tag:'.$json->etag."<br/>";
echo 'Gender:'.$json->gender."<br/>";
echo 'Display Name:'.$json->displayName."<br/>";
echo 'Family Name:'.$json->name->familyName."<br/>";
echo 'Given Name:'.$json->name->givenName."<br/>";
echo 'Tagline:'.$json->tagline."<br/>";
//echo 'BraggingRights:'.$json->braggingRights."<br/>";
//echo 'AboutMe:'.$json->aboutMe."<br/>";
//echo 'Realtionship Status:'.$json->relationshipStatus."<br/>";
echo 'URL:'.$json->url."<br/>";
echo '<img src="'.$json->image->url.'" width="100" height="100">';
//echo 'PlusOne Count:'.$json->plusOneCount."<br/>";
//echo 'Circledby Count:'.$json->circledByCount."<br/>";
?>
No comments :
Post a Comment