相关疑难解决方法(0)

使用user_id获取Google+个人资料图片网址

我知道很多社交网络API提供了一种使用user_id或用户名构建用户个人资料图片网址的方法.对于Facebook,它看起来像这样:

http://graph.facebook.com/user_id/picture?type=square

现在Google Plus有这样的东西吗?或者任何其他方式在没有API调用的情况下获取用户的图片?

google-api google-plus

89
推荐指数
5
解决办法
11万
查看次数

如何通过Google Plus中的用户ID获取用户图片?

我曾经通过这个URL获取用户图像

https://plus.google.com/s2/photos/profile/(user_id)?sz=150

但现在我得到的是404错误或没有图像.我知道谷歌已经改变了它的政策和连接方式,并允许其他人获取信息,但我没有做任何事情来达到与上述相同的结果.

注意:我不能在这里使用身份验证,因为我向其他用户显示用户的图像根本没有连接.

或者以其他方式,用户可能不是来自Google登录,但我只需向其他Google用户展示图片.

任何帮助将非常感谢!!!

编辑: 我已通过people.get方法检查

https://www.googleapis.com/plus/v1/people/11595...3592320?key=AIzaSyCkdmtNN1XDg....EpepOIIs

但我得到错误说

{
   "error": {
     "errors": [
        {
          "domain": "usageLimits",
          "reason": "accessNotConfigured",
          "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
        }
     ],
   "code": 403,
   "message": "Access Not Configured. Please use Google Developers Console to activate the API for your project."
  }
}
Run Code Online (Sandbox Code Playgroud)

编辑:我已经启用此功能,因为我已在我的网站中使用Google+登录,此处我附加了屏幕截图:

Google+ API已启用

google-api userinfo google-plus web

8
推荐指数
2
解决办法
2万
查看次数

从 googleusercontent.com 加载的图像上的 HTTP 403

首先,我认为我的问题与这些问题无关:question 1question 2
因为我没有在任何地方使用身份验证,也没有使用任何库(我不需要)。

我只是在我的 Web 应用程序中加载一些公开可用的专辑封面图像:

// urlList is an array than contains URLs like the examples given below
<img *ngFor="let url of urlList" src="url">
Run Code Online (Sandbox Code Playgroud)

示例 URL: Glass MansionSummertimeSide Effects

99% 的情况下,它有效。但有时我会在控制台上收到那些完全相同的 URL 的 403 错误。
我知道它们与身份验证无关,因为,好吧。这些 URL 可公开访问。

调试这个很困难,因为稍后刷新了几个页面,它又神奇地工作了。日志中也没有任何异常(GET 403 错误除外)。

世界正在发生什么?

我正在使用 Angular v7.2.15。浏览器:谷歌浏览器

html google-chrome get image angular

6
推荐指数
2
解决办法
3072
查看次数

标签 统计

google-api ×2

google-plus ×2

angular ×1

get ×1

google-chrome ×1

html ×1

image ×1

userinfo ×1

web ×1