【问题标题】:How to get the profile picture of gmail user using email如何使用电子邮件获取gmail用户的个人资料图片
【发布时间】:2016-10-27 18:02:24
【问题描述】:

有没有办法使用电子邮件获取 gmail 用户的个人资料图片?没有认证? 我怎么也能得到名字?

我使用了这个网址,

http://picasaweb.google.com/data/entry/api/user/{some_email_address]?alt=json

使用浏览器获取图片。 但不允许与 localhost 一起使用。

【问题讨论】:

    标签: javascript html email gmail


    【解决方案1】:

    添加&callback=<some name> 以使用JSONP

    【讨论】:

    • 我会把它放在哪里?
    【解决方案2】:

    您使用的是什么 JavaScript 平台?

    例如在nodejs中你可以使用request包和下面的示例代码:

    const request= require('request'); 
    
    request({ url: 'http://picasaweb.google.com/data/entry/api/user/{email here}?alt=json', method: 'Get', }, (err, res, body) => { console.log(body); });
    

    【讨论】:

    • 我只是在使用淘汰赛js和jquery。
    • 好的,那为什么不能在 localhost 中使用呢?
    • 同源策略。
    • 我只会建议 JSONP 的其他解决方案。
    • 顺便说一句,我使用了带有 JSONP 数据类型的 $.ajax 调用。所以它有效。我现在的问题是,如果链接响应为 404,我该如何触发函数。
    猜你喜欢
    • 2020-06-12
    • 1970-01-01
    • 2018-08-25
    • 1970-01-01
    • 2017-02-04
    • 2011-03-08
    • 1970-01-01
    • 2021-11-01
    • 1970-01-01
    相关资源
    最近更新 更多