social_oauth_api 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +32 -3
- data/lib/social_oauth_api/version.rb +3 -1
- data/lib/social_oauth_api/weibo.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmI4MGQxYzMxY2I1NWI2NDA0NjViNmE0ZDFmNWQ5OGQwNzQzOTA4OQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDAyYWYyYjNmYmFlZGNkMThhYjMwYTVjZmNlNDgyMWIxMWVhOTcxYQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MGZiYzUwNGQ2M2MxY2Y0OTIyN2FjZWY1NjVlNWEyNTczNDdhOTM3NGQwNmRj
|
10
|
+
YzI1NmFjMTU1OTE4YWRjZmYwODJmM2VkNzdhOGYyNDc0ZWNiZGYyNDIwNTA1
|
11
|
+
YzUyOGNmNWFjOTE3NmUyNWE5ODkzZDA4Njc0NDA2ZDllYjNiY2E=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MGY0OGQyNDBjOTE2OTUwYmQ5ODFkZTFjYTc4OGViYmQyOTgxYjFmYWE1NTQw
|
14
|
+
NTVjYTZmNzIzODAxYjNiM2JlNzkzMTMzODFkMTc2NjRkODYxZmFmYTkxYjQy
|
15
|
+
OGI1MWMzN2EzNTViOTcwNjhkZWUwMjc0MTM1ZWE4ODIyM2MyZDk=
|
data/README.md
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
# SocialOauthApi
|
2
2
|
|
3
|
-
|
3
|
+
用于第三方登录后获取用户信息
|
4
|
+
|
5
|
+
提供给前后端分离的框架使用
|
6
|
+
|
7
|
+
只接受前端sdk传回来的第三方 **access_token** 参数
|
8
|
+
|
9
|
+
支持微博和qq登录
|
4
10
|
|
5
11
|
## Installation
|
6
12
|
|
@@ -17,8 +23,31 @@ Or install it yourself as:
|
|
17
23
|
$ gem install social_oauth_api
|
18
24
|
|
19
25
|
## Usage
|
20
|
-
|
21
|
-
|
26
|
+
```ruby
|
27
|
+
require 'social_oauth_api'
|
28
|
+
|
29
|
+
weibo_config = {
|
30
|
+
client_id: 'xxxxxx',
|
31
|
+
access_token: 'xxxxxxxxxxx',
|
32
|
+
}
|
33
|
+
|
34
|
+
qq_config = {
|
35
|
+
client_id: 'xxxxx',
|
36
|
+
access_token: 'xxxxxxxxxxx'
|
37
|
+
}
|
38
|
+
|
39
|
+
weibo = SocialOauthApi::Weibo::User.new(weibo_config)
|
40
|
+
p weibo.id # => weibo uid
|
41
|
+
p weibo.name # => weibo screen_name
|
42
|
+
p weibo.image_url # => weibo profile_image_url
|
43
|
+
p weibo.user_info
|
44
|
+
|
45
|
+
qq = SocialOauthApi::Qq::User.new(qq_config)
|
46
|
+
p qq.id # => qq open_id
|
47
|
+
p qq.name # => qq nickname
|
48
|
+
p qq.name # => qq figureurl
|
49
|
+
p qq.user_info
|
50
|
+
```
|
22
51
|
|
23
52
|
## Contributing
|
24
53
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_oauth_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Spirit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|