I am currently using LightOpenID to allow users to log into my site, where I can automatically extract their username and email address:
$openid->required = array('namePerson/first', 'namePerson/last', 'contact/email');
$openid->identity = 'https://www.google.com/accounts/o8/id';
Here I am using the parameters namePerson/first
, namePerson/last
, and contact/email
.
I understand that inorder to get a list of user contacts, I have to use the feed:
https://www.google.com/m8/feeds
However, I can't seem to figure out which parameters I need to use for this?
If I remove the paramter line altogether, I just get an empty array back.
Can anyone please help me figure out which parameters I need to get the contacts?
Here is the current code I have:
<?php
require '/var/www/libraries/openid.php';
try {
$openid = new LightOpenID;
if(!$openid->mode) {
//$openid->required = array('gd/fullName');
$openid->identity = 'https://www.google.com/m8/feeds/contacts/oshirowanen.y%40gmail.com/full';
header('Location: ' . $openid->authUrl());
exit;
} elseif($openid->mode == 'cancel') {
echo "cancelled";
exit;
} else {
if ( $openid->validate() ) {
$returned = $openid->getAttributes();
print_r($returned);
exit;
} else {
echo "something is wrong";
exit;
}
}
} catch(ErrorException $e) {
echo $e->getMessage();
}
?>