orkut 0.0.0.9 → 0.0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/orkut/connection.rb +43 -43
- data/lib/orkut/version.rb +1 -1
- metadata +5 -5
data/lib/orkut/connection.rb
CHANGED
@@ -3,48 +3,6 @@ require 'google/api_client'
|
|
3
3
|
|
4
4
|
module Orkut
|
5
5
|
module Connection
|
6
|
-
private
|
7
|
-
|
8
|
-
def connection_v1(options={})
|
9
|
-
access_token = nil
|
10
|
-
if authenticated?
|
11
|
-
client_options = {
|
12
|
-
:site => site,
|
13
|
-
:request_token_path => request_token_path,
|
14
|
-
:access_token_path => access_token_path,
|
15
|
-
:authorize_path => authorize_path
|
16
|
-
}
|
17
|
-
consumer = ::OAuth::Consumer.new(consumer_key, consumer_secret, client_options)
|
18
|
-
# now create the access token object from passed values
|
19
|
-
token_hash = { :oauth_token => oauth_token,
|
20
|
-
:oauth_token_secret => oauth_token_secret
|
21
|
-
}
|
22
|
-
access_token = ::OAuth::AccessToken.from_hash(consumer, token_hash)
|
23
|
-
end
|
24
|
-
access_token
|
25
|
-
end
|
26
|
-
|
27
|
-
def connection(options={})
|
28
|
-
access_token = nil
|
29
|
-
if authenticated?
|
30
|
-
client = Google::APIClient.new
|
31
|
-
|
32
|
-
client.authorization.client_id = client_id
|
33
|
-
client.authorization.client_secret = client_secret
|
34
|
-
client.authorization.scope = scope
|
35
|
-
client.authorization.redirect_uri = redirect_uri
|
36
|
-
|
37
|
-
client.authorization.code = code
|
38
|
-
|
39
|
-
orkut = client.discovered_api('orkut', 'v2')
|
40
|
-
unless client.authorization.access_token
|
41
|
-
r = Rack::Response.new
|
42
|
-
r.redirect(client.authorization.authorization_uri.to_s)
|
43
|
-
r.finish
|
44
|
-
end
|
45
|
-
end
|
46
|
-
access_token
|
47
|
-
end
|
48
6
|
|
49
7
|
def authorization_uri(options={})
|
50
8
|
client = Google::APIClient.new
|
@@ -58,6 +16,48 @@ module Orkut
|
|
58
16
|
|
59
17
|
client.authorization.authorization_uri.to_s
|
60
18
|
end
|
61
|
-
|
19
|
+
|
20
|
+
private
|
21
|
+
|
22
|
+
def connection_v1(options={})
|
23
|
+
access_token = nil
|
24
|
+
if authenticated?
|
25
|
+
client_options = {
|
26
|
+
:site => site,
|
27
|
+
:request_token_path => request_token_path,
|
28
|
+
:access_token_path => access_token_path,
|
29
|
+
:authorize_path => authorize_path
|
30
|
+
}
|
31
|
+
consumer = ::OAuth::Consumer.new(consumer_key, consumer_secret, client_options)
|
32
|
+
# now create the access token object from passed values
|
33
|
+
token_hash = { :oauth_token => oauth_token,
|
34
|
+
:oauth_token_secret => oauth_token_secret
|
35
|
+
}
|
36
|
+
access_token = ::OAuth::AccessToken.from_hash(consumer, token_hash)
|
37
|
+
end
|
38
|
+
access_token
|
39
|
+
end
|
40
|
+
|
41
|
+
def connection(options={})
|
42
|
+
access_token = nil
|
43
|
+
if authenticated?
|
44
|
+
client = Google::APIClient.new
|
45
|
+
|
46
|
+
client.authorization.client_id = client_id
|
47
|
+
client.authorization.client_secret = client_secret
|
48
|
+
client.authorization.scope = scope
|
49
|
+
client.authorization.redirect_uri = redirect_uri
|
50
|
+
|
51
|
+
client.authorization.code = code
|
52
|
+
|
53
|
+
orkut = client.discovered_api('orkut', 'v2')
|
54
|
+
unless client.authorization.access_token
|
55
|
+
r = Rack::Response.new
|
56
|
+
r.redirect(client.authorization.authorization_uri.to_s)
|
57
|
+
r.finish
|
58
|
+
end
|
59
|
+
end
|
60
|
+
access_token
|
61
|
+
end
|
62
62
|
end
|
63
63
|
end
|
data/lib/orkut/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: orkut
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.0.
|
4
|
+
version: 0.0.0.10
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -13,7 +13,7 @@ date: 2011-11-01 00:00:00.000000000Z
|
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: omniauth
|
16
|
-
requirement: &
|
16
|
+
requirement: &11806560 !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ! '>='
|
@@ -21,10 +21,10 @@ dependencies:
|
|
21
21
|
version: 0.3.0
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements: *
|
24
|
+
version_requirements: *11806560
|
25
25
|
- !ruby/object:Gem::Dependency
|
26
26
|
name: multi_json
|
27
|
-
requirement: &
|
27
|
+
requirement: &11805160 !ruby/object:Gem::Requirement
|
28
28
|
none: false
|
29
29
|
requirements:
|
30
30
|
- - ! '>='
|
@@ -32,7 +32,7 @@ dependencies:
|
|
32
32
|
version: '0'
|
33
33
|
type: :runtime
|
34
34
|
prerelease: false
|
35
|
-
version_requirements: *
|
35
|
+
version_requirements: *11805160
|
36
36
|
description: A Ruby wrapper for the Orkut REST/RPC API.
|
37
37
|
email:
|
38
38
|
- contato@umanni.com
|