【问题标题】:Google+ API to get all the photosGoogle+ API 获取所有照片
【发布时间】:2013-06-04 17:32:11
【问题描述】:

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

我应该调用什么 API? [网络应用]

【问题讨论】:

    标签: javascript html api web google-plus


    【解决方案1】:

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

    【讨论】:

      【解决方案2】:

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

      您可以在此处查看来自您的公开供稿的回复:

      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 链接,其中包含对帖子所附照片的引用。

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

      【讨论】:

        【解决方案3】:

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

        【讨论】:

          【解决方案4】:

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

          查看示例解决方案(在 Chrome 扩展程序中):https://webapps.stackexchange.com/a/112527/147716

          【讨论】:

            猜你喜欢
            • 1970-01-01
            • 2017-01-11
            • 2011-08-24
            • 1970-01-01
            • 2014-02-27
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            • 1970-01-01
            相关资源
            最近更新 更多