omniauth-flickr 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +1 -1
- data/lib/omniauth/strategies/flickr.rb +16 -4
- data/lib/omniauth-flickr/version.rb +1 -1
- metadata +28 -49
data/LICENSE
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2011 Software Brewmasters Incorporated
|
2
2
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
4
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -4,7 +4,9 @@ require 'multi_json'
|
|
4
4
|
module OmniAuth
|
5
5
|
module Strategies
|
6
6
|
class Flickr < OmniAuth::Strategies::OAuth
|
7
|
+
|
7
8
|
option :name, 'flickr'
|
9
|
+
|
8
10
|
option :client_options, {
|
9
11
|
:access_token_path => "/services/oauth/access_token",
|
10
12
|
:authorize_path => "/services/oauth/authorize",
|
@@ -17,15 +19,25 @@ module OmniAuth
|
|
17
19
|
}
|
18
20
|
|
19
21
|
info do
|
20
|
-
|
21
|
-
:username => access_token.params['username'],
|
22
|
-
:full_name => access_token.params['fullname']
|
23
|
-
}
|
22
|
+
user_info
|
24
23
|
end
|
25
24
|
|
26
25
|
extra do
|
27
26
|
{}
|
28
27
|
end
|
28
|
+
|
29
|
+
def user_info
|
30
|
+
if @user_info.blank?
|
31
|
+
@user_info = {}
|
32
|
+
# This is a public API and does not need signing or authentication
|
33
|
+
url = "/services/rest/?api_key=#{options.consumer_key}&format=json&method=flickr.people.getInfo&nojsoncallback=1&user_id=#{uid}"
|
34
|
+
response = Net::HTTP.get(options.client_options[:site].gsub(/.*:\/\//, ""), url)
|
35
|
+
@user_info ||= MultiJson.decode(response.body) if response
|
36
|
+
end
|
37
|
+
@user_info
|
38
|
+
rescue ::Errno::ETIMEDOUT
|
39
|
+
raise ::Timeout::Error
|
40
|
+
end
|
29
41
|
end
|
30
42
|
end
|
31
43
|
end
|
metadata
CHANGED
@@ -1,46 +1,34 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: omniauth-flickr
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
version: 0.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.3
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
7
|
+
authors:
|
12
8
|
- Tim Breitkreutz
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-12-03 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: omniauth-oauth
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70123939761240 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
18
|
+
requirements:
|
26
19
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 1
|
30
|
-
- 0
|
31
|
-
version: "1.0"
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '1.0'
|
32
22
|
type: :runtime
|
33
|
-
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: *70123939761240
|
34
25
|
description: OmniAuth strategy for Flickr
|
35
|
-
email:
|
26
|
+
email:
|
36
27
|
- tim@sbrew.com
|
37
28
|
executables: []
|
38
|
-
|
39
29
|
extensions: []
|
40
|
-
|
41
30
|
extra_rdoc_files: []
|
42
|
-
|
43
|
-
files:
|
31
|
+
files:
|
44
32
|
- .gitignore
|
45
33
|
- Gemfile
|
46
34
|
- LICENSE
|
@@ -51,37 +39,28 @@ files:
|
|
51
39
|
- lib/omniauth-flickr/version.rb
|
52
40
|
- lib/omniauth/strategies/flickr.rb
|
53
41
|
- omniauth-flickr.gemspec
|
54
|
-
has_rdoc: true
|
55
42
|
homepage: https://github.com/timbreitkreutz/omniauth-flickr
|
56
43
|
licenses: []
|
57
|
-
|
58
44
|
post_install_message:
|
59
45
|
rdoc_options: []
|
60
|
-
|
61
|
-
require_paths:
|
46
|
+
require_paths:
|
62
47
|
- lib
|
63
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
48
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
64
49
|
none: false
|
65
|
-
requirements:
|
66
|
-
- -
|
67
|
-
- !ruby/object:Gem::Version
|
68
|
-
|
69
|
-
|
70
|
-
version: "0"
|
71
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
72
55
|
none: false
|
73
|
-
requirements:
|
74
|
-
- -
|
75
|
-
- !ruby/object:Gem::Version
|
76
|
-
|
77
|
-
- 0
|
78
|
-
version: "0"
|
56
|
+
requirements:
|
57
|
+
- - ! '>='
|
58
|
+
- !ruby/object:Gem::Version
|
59
|
+
version: '0'
|
79
60
|
requirements: []
|
80
|
-
|
81
61
|
rubyforge_project: omniauth-flickr
|
82
|
-
rubygems_version: 1.
|
62
|
+
rubygems_version: 1.8.10
|
83
63
|
signing_key:
|
84
64
|
specification_version: 3
|
85
65
|
summary: OmniAuth strategy for Flickr
|
86
66
|
test_files: []
|
87
|
-
|