Google+ API 初出茅庐,暂时只专注于公开数据

千呼万唤始出来,今天Google+ API终于揭开了面纱,不过目前这第一步还只专注于公开数据上。

如果你想获得一个人的profile信息,可以发出HTTP请求:

GET https://www.googleapis.com/plus/v1/people/108189587050871927619?key=yourAPIKey

然后即可获得JSON输出:

{
 "kind": "plus#person",
 "id": "108189587050871927619",
 "displayName": "Chris Chabot",
 "image": {
  "url": "https://lh5.googleusercontent.com/-cQNLOQzkGpE/AAAAAAAAAAI/AAAAAAAAEjo/M9_pXL-ra4Q/photo.jpg"
 },
 "organizations": [
  {
   "name": "Google+ Developer Relations",
   "title": "Developer Advocate & Manager",
   "type": "work"
  }
 ]
}

利用类似的方法你可以得到某个人最近的公开信息流:

GET https://www.googleapis.com/plus/v1/people/108189587050871927619/activities/public?key=yourAPIKey

目前你必须注册自己的应用才可以发送请求。另外还有几点:

  • 目前的API只支持RESTful HTTP请求,通过JSON返回
  • 输出的信息为标准语法(个人信息是PoCo ,活动是ActivityStrea.ms
  • 使用OAuth 2安全而可信的访问用户数据

关于Google+ API的具体信息可以参考:developers.google.com/+

Via Google Plus Plaform


© musiXboy 发表于 谷奥——探寻谷歌的奥秘 ( http://www.guao.hk ), 2011. |
没有评论 |
永久链接 |
关于谷奥 |
投稿/爆料
Post tags: , ,


from 谷奥——探寻谷歌的奥秘: http://www.guao.hk/posts/getting-started-on-the-google-plus-api.html

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: