omniauth-flickr 0.0.9 → 0.0.10

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.
data/README.md CHANGED
@@ -6,6 +6,9 @@ For more information see the following:
6
6
 
7
7
  Release notes:
8
8
 
9
+ * Version 0.0.10
10
+
11
+ - Fix bugs for users without avatars (thanks viseztrance)
9
12
 
10
13
  * Version 0.0.9
11
14
 
@@ -7,9 +7,9 @@ module OmniAuth
7
7
  # An omniauth 1.0 strategy for Flickr authentication
8
8
  # Based on http://www.flickr.com/services/api/auth.oauth.html
9
9
  class Flickr < OmniAuth::Strategies::OAuth
10
-
10
+
11
11
  option :name, 'flickr'
12
-
12
+
13
13
  option :client_options, {
14
14
  :access_token_path => "/services/oauth/access_token",
15
15
  :authorize_path => "/services/oauth/authorize",
@@ -17,11 +17,11 @@ module OmniAuth
17
17
  :site => "http://www.flickr.com"
18
18
  }
19
19
 
20
- uid {
20
+ uid {
21
21
  access_token.params['user_nsid']
22
22
  }
23
-
24
- info do
23
+
24
+ info do
25
25
  {
26
26
  :name => access_token.params['username'],
27
27
  :nickname => access_token.params['fullname'],
@@ -35,18 +35,18 @@ module OmniAuth
35
35
  },
36
36
  :mbox_sha1sum => user_info["mbox_sha1sum"],
37
37
  :location => user_info["location"],
38
- :image => "http://farm#{user_info["iconfarm"]}.static.flickr.com/#{user_info["iconserver"]}/buddyicons/#{uid}.jpg"
38
+ :image => image_info
39
39
  }
40
40
  end
41
-
41
+
42
42
  extra do
43
43
  {
44
44
  :raw_info => raw_info
45
45
  }
46
46
  end
47
47
 
48
- # Return info gathered from the flickr.people.getInfo API call
49
-
48
+ # Return info gathered from the flickr.people.getInfo API call
49
+
50
50
  def raw_info
51
51
  # This is a public API and does not need signing or authentication
52
52
  request = "/services/rest/?format=json&method=flickr.people.getInfo&nojsoncallback=1&user_id=#{uid}"
@@ -56,11 +56,17 @@ module OmniAuth
56
56
  end
57
57
 
58
58
  # Provide the "Person" portion of the raw_info
59
-
59
+
60
60
  def user_info
61
61
  @user_info ||= raw_info.nil? ? {} : raw_info["person"]
62
62
  end
63
-
63
+
64
+ def image_info
65
+ if user_info["iconfarm"] > 0
66
+ "http://farm#{user_info["iconfarm"]}.static.flickr.com/#{user_info["iconserver"]}/buddyicons/#{uid}.jpg"
67
+ end
68
+ end
69
+
64
70
  def request_phase
65
71
  options[:authorize_params] = {:perms => options[:scope]} if options[:scope]
66
72
  super
@@ -1,5 +1,5 @@
1
1
  module Omniauth
2
2
  module Flickr
3
- VERSION = "0.0.9"
3
+ VERSION = "0.0.10"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,46 +1,39 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: omniauth-flickr
3
- version: !ruby/object:Gem::Version
4
- prerelease: false
5
- segments:
6
- - 0
7
- - 0
8
- - 9
9
- version: 0.0.9
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.10
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
- date: 2011-12-09 00:00:00 -07:00
18
- default_executable:
19
- dependencies:
20
- - !ruby/object:Gem::Dependency
12
+ date: 2012-11-14 00:00:00.000000000 Z
13
+ dependencies:
14
+ - !ruby/object:Gem::Dependency
21
15
  name: omniauth-oauth
22
- prerelease: false
23
- requirement: &id001 !ruby/object:Gem::Requirement
16
+ requirement: !ruby/object:Gem::Requirement
24
17
  none: false
25
- requirements:
18
+ requirements:
26
19
  - - ~>
27
- - !ruby/object:Gem::Version
28
- segments:
29
- - 1
30
- - 0
31
- version: "1.0"
20
+ - !ruby/object:Gem::Version
21
+ version: '1.0'
32
22
  type: :runtime
33
- version_requirements: *id001
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ none: false
26
+ requirements:
27
+ - - ~>
28
+ - !ruby/object:Gem::Version
29
+ version: '1.0'
34
30
  description: OmniAuth strategy for Flickr
35
- email:
31
+ email:
36
32
  - tim@sbrew.com
37
33
  executables: []
38
-
39
34
  extensions: []
40
-
41
35
  extra_rdoc_files: []
42
-
43
- files:
36
+ files:
44
37
  - .gitignore
45
38
  - Gemfile
46
39
  - LICENSE
@@ -51,37 +44,28 @@ files:
51
44
  - lib/omniauth-flickr/version.rb
52
45
  - lib/omniauth/strategies/flickr.rb
53
46
  - omniauth-flickr.gemspec
54
- has_rdoc: true
55
47
  homepage: https://github.com/timbreitkreutz/omniauth-flickr
56
48
  licenses: []
57
-
58
49
  post_install_message:
59
50
  rdoc_options: []
60
-
61
- require_paths:
51
+ require_paths:
62
52
  - lib
63
- required_ruby_version: !ruby/object:Gem::Requirement
53
+ required_ruby_version: !ruby/object:Gem::Requirement
64
54
  none: false
65
- requirements:
66
- - - ">="
67
- - !ruby/object:Gem::Version
68
- segments:
69
- - 0
70
- version: "0"
71
- required_rubygems_version: !ruby/object:Gem::Requirement
55
+ requirements:
56
+ - - ! '>='
57
+ - !ruby/object:Gem::Version
58
+ version: '0'
59
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
60
  none: false
73
- requirements:
74
- - - ">="
75
- - !ruby/object:Gem::Version
76
- segments:
77
- - 0
78
- version: "0"
61
+ requirements:
62
+ - - ! '>='
63
+ - !ruby/object:Gem::Version
64
+ version: '0'
79
65
  requirements: []
80
-
81
66
  rubyforge_project: omniauth-flickr
82
- rubygems_version: 1.3.7
67
+ rubygems_version: 1.8.24
83
68
  signing_key:
84
69
  specification_version: 3
85
70
  summary: OmniAuth strategy for Flickr
86
71
  test_files: []
87
-