0

如何在 Twitter 中获取我的追随者电子邮件 ID?我尝试了以下代码,但它不返回电子邮件ID,它只返回名称和屏幕。

<script src="http://code.jquery.com/jquery-latest.js"></script>
<?php
$trends_url = "http://api.twitter.com/1/statuses/followers/gunarsekar.json";
////// exmaple $trends_url = "http://api.twitter.com/1/statuses/followers/w3cgallery.json"; or $trends_url = "http://api.twitter.com/1/statuses/followers/22250021.json";

$ch = curl_init(); 

curl_setopt($ch, CURLOPT_URL, $trends_url);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

$curlout = curl_exec($ch);

curl_close($ch);

$response = json_decode($curlout, true);
// print_r($response);
foreach($response as $friends){
 print_r($friends);
 echo "<br><br>";
$thumb = $friends['profile_image_url'];

$url = $friends['screen_name'];

$name = $friends['name'];

?>



<a title="<?php echo $name;?>" href="http://www.twitter.com/<?php echo $url;?>"><img class="photo-img" src="<?php echo $thumb?>" border="0" alt="" width="40" /></a>
<?php
} 

?>

请帮助我从 Twitter 获取电子邮件地址。

4

3 回答 3

4

Twitter API 甚至不提供经过身份验证的用户的电子邮件......所以,提供关注者的电子邮件是不可能的......对于发送消息,您应该尝试 API 发送直接消息

我使用亚伯拉罕 API https://github.com/abraham/twitteroauth

如何使用 Abraham 的 oauth 库发送直接消息

于 2012-12-01T12:39:15.437 回答
3

Twitter API 不返回用户的电子邮件地址

于 2012-05-18T06:18:22.467 回答
1

查看此https://dev.twitter.com/docs/faq#6718

于 2012-05-18T06:23:05.840 回答