omniauth-douban-oauth2 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,21 +16,19 @@ module OmniAuth
16
16
  }
17
17
 
18
18
  uid do
19
- raw_info['id'].split('/').last
19
+ raw_info['id']
20
20
  end
21
21
 
22
22
  info do
23
23
  {
24
- :name => raw_info['title'],
25
- :nickname => raw_info['uid'],
26
- :signature => raw_info['signature'],
27
- :content => raw_info['content'],
28
- :location => raw_info['location'] ? raw_info['location']['__content__'] : nil,
29
- :links => {
30
- :self => raw_info['link'].find{ |l| l['rel'] == 'self' }['href'],
31
- :icon => raw_info['link'].find{ |l| l['rel'] == 'icon' }['href'],
32
- :douban => raw_info['link'].find{ |l| l['rel'] == 'alternate' }['href'],
33
- }
24
+ :uid => raw_info['uid'],
25
+ :name => raw_info['name'],
26
+ :loc => raw_info['loc'],
27
+ :avatar => raw_info['avatar'],
28
+ :url => raw_info['alt'],
29
+ :desc => raw_info['desc'],
30
+ :status => raw_info['status'],
31
+ :created => raw_info['created']
34
32
  }
35
33
  end
36
34
 
@@ -40,7 +38,8 @@ module OmniAuth
40
38
 
41
39
  def raw_info
42
40
  access_token.options[:param_name] = 'access_token'
43
- @raw_info ||= access_token.get('/people/51789002').parsed['entry']
41
+ user_id = access_token.get('/shuo/users/@me').parsed['uid']
42
+ @raw_info ||= access_token.get("/v2/people/#{ user_id }").parsed
44
43
  rescue ::Timeout::Error => e
45
44
  raise e
46
45
  end
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module Douban
3
- VERSION = '0.0.2'
3
+ VERSION = '0.0.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-douban-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-07-12 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: omniauth
16
- requirement: &2152255720 !ruby/object:Gem::Requirement
16
+ requirement: &2156128520 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '1.0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *2152255720
24
+ version_requirements: *2156128520
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: omniauth-oauth2
27
- requirement: &2152187820 !ruby/object:Gem::Requirement
27
+ requirement: &2156060640 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '1.1'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *2152187820
35
+ version_requirements: *2156060640
36
36
  description: OmniAuth OAuth2 strategy for Douban.
37
37
  email:
38
38
  - i@liluo.org