如何使用 codebird.php 检索 Twitter 用户电子邮件

how to retrieve twitter user email using codebird.php

有什么方法可以使用 codebird.php

请求 Twitter 用户电子邮件地址和 avartarURL

目前我只获取网名

我正在做的是:

$reply = $this->client->oauth_requestToken(array('oauth_callback' => $this->clientCallback));

我目前正在关注的教程:

PartFour 这会让您了解从前 5 分钟开始发生的事情。

您可以通过调用 account/verify_credentials Twitter API 方法请求用户的电子邮件地址,将可选的 include_email 参数设置为 1:

$reply = $cb->account_verifyCredentials([
  'include_email' => 1
]);
print_r($reply);

这仅适用于可以向启用的用户请求电子邮件地址的选项的 Twitter 应用程序。

developer.twitter.com. Privacy Policy URL and Terms of Service URL fields must be completed in the app settings in order for email address access to function. If enabled, users will be informed via the oauth/authorize 对话框中的应用权限下方提供了“请求用户的电子邮件地址”复选框,您的应用可以访问他们的电子邮件地址。

请注意 - 您的应用需要为之前经过身份验证的用户重新生成用户访问令牌才能访问他们的电子邮件地址。

请注意 - 您可以查看和编辑现有的 Twitter apps via the Twitter app dashboard if you are logged into your Twitter account on developer.twitter.com