【问题标题】:How to get user email from TwitterApi如何从 TwitterApi 获取用户电子邮件
【发布时间】:2016-03-16 14:14:12
【问题描述】:

我已经在我的网站上成功实现了 twitter API:

使用的 API:Abraham Williams 的 Twitter oAuth

http://fr.illustranews.com

我已请求 twitter 的扩展许可,以便能够获取登录用户的电子邮件。

但是,当我查看来自 twitter 的回复时,我没有找到电子邮件。

下面是回复:

stdClass Object (
    [id] => 159518456 
    [id_str] => 159518456 
    [name] => Mautech Consulting 
    [screen_name] => Mau_tech 
    [location] => Viney road, Calodyne,Mauritius 
    [description] => Your IT Consulting expert. We are the creators of http://t.co/lCXGEiOsrT 
    [url] => http://t.co/vFV9W9m5NJ 
    [entities] => stdClass Object ( 
        [url] => stdClass Object ( 
            [urls] => Array ( 
                [0] => stdClass Object ( 
                    [url] => http://t.co/vFV9W9m5NJ 
                    [expanded_url] => http://www.mautechconsulting.com 
                    [display_url] => mautechconsulting.com 
                    [indices] => Array ( [0] => 0 [1] => 22 
                ) 
            ) 
        ) 
    ) 
    [description] => stdClass Object ( 
    [urls] => Array ( 
        [0] => stdClass Object ( 
            [url] => http://t.co/lCXGEiOsrT 
            [expanded_url] => http://www.professionals.mu 
            [display_url] => professionals.mu 
            [indices] => Array ( [0] => 50 [1] => 72 ) ) ) ) ) 
    [protected] => 
    [followers_count] => 1403 
    [friends_count] => 1805 
    [listed_count] => 5 
    [created_at] => Fri Jun 25 16:14:34 +0000 2010 
    [favourites_count] => 2 
    [utc_offset] => 14400 
    [time_zone] => Abu Dhabi 
    [geo_enabled] => 
    [verified] => 
    [statuses_count] => 341 
    [lang] => en 
    [status] => stdClass Object ( 
        [created_at] => Fri Mar 11 09:08:37 +0000 2016 
        [id] => 708218057567682560 
        [id_str] => 708218057567682560 
        [text] => VPS Hosting | Windows Cloud Hosting | Windows Reseller - AccuWeb Hosting https://t.co/0exTmiLClc 
        [truncated] => 
        [source] => Facebook 
        [in_reply_to_status_id] => 
        [in_reply_to_status_id_str] => 
        [in_reply_to_user_id] => [
        in_reply_to_user_id_str] => 
        [in_reply_to_screen_name] => 
        [geo] => 
        [coordinates] => 
        [place] => 
        [contributors] => 
        [is_quote_status] => 
        [retweet_count] => 0 
        [favorite_count] => 0 
        [entities] => stdClass Object ( 
            [hashtags] => Array ( ) 
            [symbols] => Array ( ) 
            [user_mentions] => Array ( ) 
            [urls] => Array ( 
                [0] => stdClass Object ( 
                    [url] => https://t.co/0exTmiLClc 
                    [expanded_url] => http://fb.me/4uCDHL6lZ 
                    [display_url] => fb.me/4uCDHL6lZ 
                    [indices] => Array ( [0] => 73 [1] => 96 ) 
                ) 
            ) 
        ) 
        [favorited] => 
        [retweeted] => 
        [possibly_sensitive] => 
        [lang] => en 
    ) 
    [contributors_enabled] => 
    [is_translator] => 
    [is_translation_enabled] => 
    [profile_background_color] => F0F5F5 
    [profile_background_image_url] => http://pbs.twimg.com/profile_background_images/436354814457303040/nOQaWO-w.png 
    [profile_background_image_url_https] => https://pbs.twimg.com/profile_background_images/436354814457303040/nOQaWO-w.png 
    [profile_background_tile] => 
    [profile_image_url] => http://pbs.twimg.com/profile_images/378800000801085164/b77fd09a53c4dcca068297874728c2fb_normal.png 
    [profile_image_url_https] => https://pbs.twimg.com/profile_images/378800000801085164/b77fd09a53c4dcca068297874728c2fb_normal.png 
    [profile_link_color] => 0084B4 
    [profile_sidebar_border_color] => FFFFFF 
    [profile_sidebar_fill_color] => DDFFCC 
    [profile_text_color] => 333333 
    [profile_use_background_image] => 1 
    [has_extended_profile] => 
    [default_profile] => 
    [default_profile_image] => 
    [following] => 
    [follow_request_sent] => 
    [notifications] => 
)

你能帮忙吗?

【问题讨论】:

    标签: php email twitter-oauth


    【解决方案1】:

    除非您的应用被列入白名单,否则无法使用 Twitter API 获取用户的电子邮件地址。

    检查这个 SO 答案:https://stackoverflow.com/a/3627563/5663598 以及来自该答案的链接作为参考:

    API 调用详情:https://dev.twitter.com/rest/reference/get/account/verify_credentials

    【讨论】:

      猜你喜欢
      • 2012-02-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-10
      • 1970-01-01
      • 1970-01-01
      • 2016-12-16
      • 2019-06-25
      相关资源
      最近更新 更多