omniauth-renren-oauth2 0.0.2 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 66bb9cb5e256380946b49e88721f9b674df1561a
4
- data.tar.gz: 92ee22c168137895a77e908b59034258406be755
3
+ metadata.gz: 8423eb51d7715c01fd170338082fc184ef5385f7
4
+ data.tar.gz: 31c458b5c437b559230603d42fff0e8afeae2205
5
5
  SHA512:
6
- metadata.gz: 9e506b9891944abccefb3584f0640c8af609133d665f10b946c232271b584a673a92a8b29ac9af7e4dc7a96ccc2eaacf44ea3d36a51fda6814cdf20f750c9196
7
- data.tar.gz: bcc4866b09ff1bab548272bac6309606b4d9a25319b4958c4a344094b4072eca396607c8aab088b021e3523f828875286f85dac51e000978ed55cad6f7e68881
6
+ metadata.gz: 7704a7b6ef47be2535882deff859134abb1c231e9f6ebe3929c2f0ea593f642eda76f213f2738d22fdfae2c910f89aa3c0192785a2dbd2e3bd182feca43e1faf
7
+ data.tar.gz: e4a2d085bdb0c0f10207107eb901a9858eb902dbf7a2376a927cac9f1907d9576c829d2ab3bbed7dee58054ed4cc756c1014efd642476100957d82d774b190d6
@@ -1,5 +1,4 @@
1
1
  require 'omniauth-oauth2'
2
- require 'multi_json'
3
2
 
4
3
  module OmniAuth
5
4
  module Strategies
@@ -10,15 +9,15 @@ module OmniAuth
10
9
  :token_url => '/oauth/token'
11
10
  }
12
11
 
13
- uid { raw_info['uid'] }
12
+ uid { raw_info['id'] }
14
13
 
15
14
  info do
16
15
  {
17
16
  :name => raw_info['name'],
18
17
  :nickname => raw_info['name'],
19
- :image => raw_info["tinyurl"],
18
+ :image => raw_info['avatar'][0]['url'],
20
19
  :urls => {
21
- 'Renren' => "http://www.renren.com/#{raw_info["uid"]}/profile"
20
+ 'Renren' => "http://www.renren.com/#{raw_info["id"]}/profile"
22
21
  }
23
22
  }
24
23
  end
@@ -32,8 +31,8 @@ module OmniAuth
32
31
  def raw_info
33
32
  access_token.options[:mode] = :query
34
33
  access_token.options[:param_name] = 'access_token'
35
- params ||= { :v => "1.0", :format => "json", :call_id => Time.now.to_i, :method => "users.getInfo" }
36
- @raw_info ||= MultiJson.decode(access_token.post( "https://api.renren.com/restserver.do", body: params).body)[0]
34
+ @uid ||= access_token.get("https://api.renren.com/v2/user/login/get").parsed['response']['id']
35
+ @raw_info ||= access_token.get("https://api.renren.com/v2/user/get", :params => {'userId' => @uid}).parsed['response']
37
36
  end
38
37
  end
39
38
  end
@@ -1,5 +1,5 @@
1
1
  module OmniAuth
2
2
  module RenrenOauth2
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth-renren-oauth2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - ye.li
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-03-25 00:00:00.000000000 Z
11
+ date: 2013-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth
@@ -73,7 +73,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
73
73
  version: '0'
74
74
  requirements: []
75
75
  rubyforge_project:
76
- rubygems_version: 2.0.0
76
+ rubygems_version: 2.0.3
77
77
  signing_key:
78
78
  specification_version: 4
79
79
  summary: OmniAuth Oauth2 strategy for renren.com