Project

glass_sdk

0.0
No commit activity in last 3 years
No release in over 3 years
Google OAuth2.0 and Google Glass API
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 4.0.0
 Project Readme

GlassSdk

===

一个google api的sdk

install

在你的gemfile里面加入

gem 'google_sdk'

rails g google_sdk:install

打开config/initializers/glass_sdk.rb, 修改你的client_id和client_secret, 和修改你需要的权限.

使用

base = GlassSdk::OAuth.new("你的回调地址") base.login_url # 获取用户授权地址 resp = base.user_token "xxx" #传入google 传输回来的code, 获取用户的信息 resp.body # 获取用户信息

定义自己的服务

class Timeline
  include API
  base_uri "/mirror/v1/timeline"
end
Timeline.get(Authorization: "Bearer ya29.AHES6xxxJbinPzPG-nr3EZMan0SNFe7fbhImvvxm5Ar2tBsnAb8NMJaU")

This project rocks and uses MIT-LICENSE.