How te get user adress?


#1

Hi,

I would like to kow which method to use to get the user email who is logged, i did not find it by the get_accountVerify_credentials() method

There is my code:

$Twitter = new EpiTwitter($consumer_key, $consumer_secret);
	?>
		<a href="<?php echo $Twitter->getAuthenticateUrl() ?>">TWITTER CONNEXION</a>
	<?php
		if (isset($_GET['oauth_token']) || (isset($_COOKIE['oauth_token']) && isset($_COOKIE['oauth_token_secret'])))
		{
			if (!isset($_COOKIE['oauth_token']) || !isset($_COOKIE['oauth_token_secret']) )
			{
				$Twitter->setToken($_GET['oauth_token']);
				$token = $Twitter->getAccessToken();
				setcookie('oauth_token', $token->oauth_token);
				setcookie('oauth_token_secret', $token->oauth_token_secret);
				$Twitter->setToken($token->oauth_token, $token->oauth_token_secret);
			}
			else
			{
				$Twitter->setToken($_COOKIE['oauth_token'],$_COOKIE['oauth_token_secret']);
			}
			$user = $Twitter->get_accountVerify_credentials();
			echo var_dump($user);
		}
		elseif (isset($_GET['denied']))
		{ ?>
			<a href="<?php echo $Twitter->getAuthenticateUrl() ?>">TWITTER CONNEXION</a> <?php
			echo 'You must sign in through twitter first';
		}
		else
		{ ?>
			<a href="<?php echo $Twitter->getAuthenticateUrl() ?>">TWITTER CONNEXION</a> <?php
			echo 'You are not logged in';
		}
	?>

Thanks for help !


#2

You cannot obtain the user’s email address with the Twitter API – it’s not a piece of data that is part of the API.


#3

then what is the solution for this .I also have the same problem.Please guide us to get user’s full info.Please reply ASAP


#4

The solution is to get creative. The information is not part of the Twitter API, so if the data is important to you then you need to devise a different, respectful way to obtain it. A common way to achieve this is to simply ask the user from within your application.