4

我已经完成了 google+ 身份验证,现在我可以访问用户 ID、访问令牌等。我想从 google plus 或 picasa 访问用户的个人照片和共享照片 [任何对我有用的东西]。

我应该调用什么 API?[Web应用程序]

4

4 回答 4

2

虽然没有照片 API,但您可以阅读活动以查找带有附加图像的公开帖子。这些帖子将包含一个完整的图像 url,可用于呈现/检索帖子上的内容。

您可以在此处查看来自您的公共供稿的响应:

https://developers.google.com/apis-explorer/#p/plus/v1/plus.activities.list?userId=me&collection=public&_h=1&

您会寻找以下帖子:

"verb": "post",
"object": {
"objectType": "note",
"content": "Off the grid!",
"url": "https://plus.google.com/109716647623830091721/posts/FH1rcTBiizW",
"replies": {
 "totalItems": 0,
 "selfLink": "https://www.googleapis.com/plus/v1/activities/z13dwdcw1sy4ztf2p22uydqhrp34gx5np/comments"
},
[....]
"attachments": [
 {
  "objectType": "photo",
  "displayName": "Off the grid!",
  "id": "109716647623830091721.5886945550216000274",
  "content": "6/7/13 - 1",
  "url": "https://plus.google.com/photos/109716647623830091721/albums/5886945550885266913/5886945550216000274",
  "image": {
   "url": "https://lh4.googleusercontent.com/-pGPWKUoUopE/UbKhyZyw8xI/AAAAAAAASsw/6aRt78UJlnc/w506-h750/photo.jpg",
   "type": "image/jpeg",
   "height": 750,
   "width": 506
  },
  "fullImage": {
   "url": "https://lh4.googleusercontent.com/-pGPWKUoUopE/UbKhyZyw8xI/AAAAAAAASsw/6aRt78UJlnc/photo.jpg",
   "type": "image/jpeg",
   "height": 4880,
   "width": 1456
  }
 }
]

},

在附件中,您将看到包含对附加到帖子的照片的引用的 fullImage 链接。

请注意,相册的工作方式会有所不同。

于 2013-06-10T17:02:22.160 回答
2

目前没有 Google+ Photos API。此时您能做的最好的事情就是使用 Picasa Web API。有关详细信息,请参阅https://developers.google.com/picasa-web/

于 2013-06-09T19:40:40.163 回答
0

我使用 Picasa API 为我的应用获取照片,请随时将其用作参考。 https://bitbucket.org/blackey02/city-log

于 2016-04-21T05:22:45.417 回答
0

请注意,如果您想上传图片,Picasa API 似乎有跨域限制。因此,要上传图片,您需要使用服务器/代理或帮助 Chrome 扩展程序。(因为那些不具有与网页代码相同的跨域限制——至少在清单中设置了正确的权限时)

请参阅此处以获取示例解决方案(在 Chrome 扩展中):https ://webapps.stackexchange.com/a/112527/147716

于 2017-12-07T08:37:20.927 回答