flickrie 0.7.0 → 0.7.1

Sign up to get free protection for your applications and to get access to all the features.
data/.gitignore CHANGED
@@ -1,7 +1,7 @@
1
1
  TODO.md
2
2
  Gemfile.lock
3
3
  pkg/
4
- credentials.rb
5
4
  doc/
6
5
  .DS_Store
7
6
  spec/vcr_cassettes
7
+ api_methods.md
data/CHANGELOG.md CHANGED
@@ -1,25 +1,12 @@
1
1
  # Flickrie changelog
2
2
 
3
- ## Version 1.0.0
3
+ ## Version 0.7.1
4
4
 
5
- - cover `flickr.photos.getFavorites` and `flickr.test.login`
6
- - change the way `flickr.photos.getContext` works (this is the part that is NOT backwards compatible)
7
-
8
- Before:
9
- ```ruby
10
- context = Flickrie.get_photo_context(712472397)
11
- context['count'] # => 12
12
- context['prevphoto'] # => #<Photo: ...>
13
- context['nexphoto'] # => #<Photo: ...>
14
- ```
15
- Now:
16
- ```ruby
17
- context = Flickrie.get_photo_context(712472397)
18
- context.count # => 12
19
- context.previous # => #<Photo: ...>
20
- context.next # => #<Photo: ...>
21
- ```
5
+ - fixed an oauth bug
6
+
7
+ ## Version 0.7.0
22
8
 
9
+ - cover `flickr.photos.getFavorites` and `flickr.test.login`
23
10
  - bug fixes (especially regarding the `Flickr::Instance`)
24
11
 
25
12
  ## Version 0.6.1
data/README.md CHANGED
@@ -214,19 +214,6 @@ default.
214
214
  Please, feel free to post any issues that you're having, I will be happy
215
215
  to help. I will also be happy if you let me know about any bugs.
216
216
 
217
- ## How to contribute
218
-
219
- I will be happy if you want to contribute. The procedure is nothing
220
- special, you just fork the project and send me a pull request.
221
-
222
- For your tests to be able to run, you should make a Flickr account, and
223
- get the API key and secret. You can get them [here](http://www.flickr.com/services/apps/create/apply).
224
- You also have to get the access token. You can do that by using my
225
- authentication system. After you have these four things, you have to
226
- assign them to environment variables named `FLICKR_API_KEY`,
227
- `FLICKR_SHARED_SECRET`, `FLICKR_ACCESS_TOKEN`, `FLICKR_ACCESS_SECRET`.
228
- Once you do that, you should be able to run tests.
229
-
230
217
  ## Cedits
231
218
 
232
219
  Special thanks to @**mislav**, my brother, he helped me really a lot
@@ -266,6 +253,9 @@ basis of this gem.
266
253
  "flickr.photosets.getInfo" -> Flickrie.get_set_info
267
254
  "flickr.photosets.getList" -> Flickrie.sets_from_user
268
255
  "flickr.photosets.getPhotos" -> Flickrie.photos_from_set
256
+
257
+ # test
258
+ "flickr.test.login" -> Flickrie.test_login
269
259
  ```
270
260
 
271
261
  ## Changelog
data/Rakefile CHANGED
@@ -11,7 +11,12 @@ task :spec, :spec do |task, args|
11
11
  end
12
12
 
13
13
  task :console do
14
- system "bundle exec pry -I. --require 'flickrie' --require 'credentials'"
14
+ begin
15
+ require 'pry'
16
+ system "bundle exec pry -I. --require 'flickrie' --require 'credentials'"
17
+ rescue LoadError
18
+ system "bundle exec irb -I. -r 'flickrie' -r 'credentials'"
19
+ end
15
20
  end
16
21
 
17
22
  task :rdoc do
data/credentials.rb ADDED
@@ -0,0 +1,4 @@
1
+ Flickrie.api_key = ENV['FLICKR_API_KEY']
2
+ Flickrie.shared_secret = ENV['FLICKR_SHARED_SECRET']
3
+ Flickrie.access_token = ENV['FLICKR_ACCESS_TOKEN']
4
+ Flickrie.access_secret = ENV['FLICKR_ACCESS_SECRET']
@@ -8,9 +8,8 @@ module Flickrie
8
8
  def region() place('region') end
9
9
  def country() place('country') end
10
10
 
11
- def [](key)
12
- @info[key]
13
- end
11
+ def [](key) @info[key] end
12
+ def hash() @info end
14
13
 
15
14
  private
16
15
 
@@ -86,9 +86,8 @@ module Flickrie
86
86
 
87
87
  def favorites() @info['person'].map { |info| User.new(info) } rescue nil end
88
88
 
89
- def [](key)
90
- @info[key]
91
- end
89
+ def [](key) @info[key] end
90
+ def hash() @info end
92
91
 
93
92
  def get_info(params = {}, info = nil)
94
93
  info ||= Flickrie.client.get_media_info(id, params).body['photo']
@@ -18,9 +18,10 @@ module Flickrie
18
18
  dates.first..dates.last
19
19
  end
20
20
 
21
- def [](key)
22
- @info[key]
23
- end
21
+ def [](key) @info[key] end
22
+ def hash() @info end
23
+
24
+ private
24
25
 
25
26
  def initialize(info, params)
26
27
  @info = info
@@ -37,6 +37,7 @@ module Flickrie
37
37
  class ParseResponseParams < FaradayMiddleware::ResponseMiddleware # :nodoc:
38
38
  define_parser do |body|
39
39
  params_array = body.split('&').map { |param| param.split('=') }
40
+ params_array.map! { |params| params.count == 1 ? params << "" : params}
40
41
  Hash[*params_array.flatten]
41
42
  end
42
43
  end
data/lib/flickrie/set.rb CHANGED
@@ -39,9 +39,8 @@ module Flickrie
39
39
  "http://www.flickr.com/photos/#{owner.nsid}/sets/#{id}"
40
40
  end
41
41
 
42
- def [](key)
43
- @info[key]
44
- end
42
+ def [](key) @info[key] end
43
+ def hash() @info end
45
44
 
46
45
  def get_info(info = nil)
47
46
  info ||= Flickrie.client.get_set_info(id).body['photoset']
@@ -9,9 +9,10 @@ module Flickrie
9
9
 
10
10
  def imported_at() Time.at(Integer(@info['imported'])) rescue nil end
11
11
 
12
- def [](key)
13
- @info[key]
14
- end
12
+ def [](key) @info[key] end
13
+ def hash() @info end
14
+
15
+ private
15
16
 
16
17
  def initialize(info)
17
18
  @info = info
data/lib/flickrie/user.rb CHANGED
@@ -43,9 +43,8 @@ module Flickrie
43
43
 
44
44
  def pro?() Integer(@info['ispro']) == 1 rescue nil end
45
45
 
46
- def [](key)
47
- @info[key]
48
- end
46
+ def [](key) @info[key] end
47
+ def hash() @info end
49
48
 
50
49
  def get_info(params = {}, info = nil)
51
50
  info ||= Flickrie.client.get_user_info(nsid, params).body['person']
@@ -1,3 +1,3 @@
1
1
  module Flickrie
2
- VERSION = '0.7.0'
2
+ VERSION = '0.7.1'
3
3
  end
data/spec/media_spec.rb CHANGED
@@ -12,7 +12,7 @@ describe Flickrie::Media do
12
12
  :media_status => 'ready',
13
13
  :path_alias => nil,
14
14
  :camera => 'Canon PowerShot G12',
15
- :views_count => 2,
15
+ :views_count => 4,
16
16
  :comments_count => 1,
17
17
  :location => {
18
18
  :latitude => 45.807258,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: flickrie
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.7.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-05-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: faraday_middleware
16
- requirement: &70307679696400 !ruby/object:Gem::Requirement
16
+ requirement: &70178662643280 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70307679696400
24
+ version_requirements: *70178662643280
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: simple_oauth
27
- requirement: &70307679694200 !ruby/object:Gem::Requirement
27
+ requirement: &70178662641000 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0.1'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *70307679694200
35
+ version_requirements: *70178662641000
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: multi_xml
38
- requirement: &70307679690400 !ruby/object:Gem::Requirement
38
+ requirement: &70178662635400 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0.4'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *70307679690400
46
+ version_requirements: *70178662635400
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: activesupport
49
- requirement: &70307679685540 !ruby/object:Gem::Requirement
49
+ requirement: &70178662632800 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '3'
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70307679685540
57
+ version_requirements: *70178662632800
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: rspec
60
- requirement: &70307679677700 !ruby/object:Gem::Requirement
60
+ requirement: &70178662627460 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '2'
66
66
  type: :development
67
67
  prerelease: false
68
- version_requirements: *70307679677700
68
+ version_requirements: *70178662627460
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: vcr
71
- requirement: &70307679504440 !ruby/object:Gem::Requirement
71
+ requirement: &70178658522680 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,7 +76,7 @@ dependencies:
76
76
  version: '0'
77
77
  type: :development
78
78
  prerelease: false
79
- version_requirements: *70307679504440
79
+ version_requirements: *70178658522680
80
80
  description: This gem is a nice wrapper for the Flickr API with an intuitive interface.
81
81
  email: janko.marohnic@gmail.com
82
82
  executables: []
@@ -89,7 +89,7 @@ files:
89
89
  - LICENSE
90
90
  - README.md
91
91
  - Rakefile
92
- - api_methods.md
92
+ - credentials.rb
93
93
  - flickrie.gemspec
94
94
  - lib/flickrie.rb
95
95
  - lib/flickrie/api_methods.rb
data/api_methods.md DELETED
@@ -1,297 +0,0 @@
1
- # activity
2
-
3
- - flickr.activity.userComments
4
- - flickr.activity.userPhotos
5
-
6
- # auth
7
-
8
- - flickr.auth.checkToken
9
- - flickr.auth.getFrob
10
- - flickr.auth.getFullToken
11
- - flickr.auth.getToken
12
-
13
- # auth.oauth
14
-
15
- - flickr.auth.oauth.checkToken
16
- - flickr.auth.oauth.getAccessToken
17
-
18
- # blogs
19
-
20
- - flickr.blogs.getList
21
- - flickr.blogs.getServices
22
- - flickr.blogs.postPhoto
23
-
24
- # collections
25
-
26
- - flickr.collections.getInfo
27
- - flickr.collections.getTree
28
-
29
- # commons
30
-
31
- - flickr.commons.getInstitutions
32
-
33
- # contacts
34
-
35
- - flickr.contacts.getList
36
- - flickr.contacts.getListRecentlyUploaded
37
- - flickr.contacts.getPublicList
38
- - flickr.contacts.getTaggingSuggestions
39
-
40
- # favorites
41
-
42
- - flickr.favorites.add
43
- - flickr.favorites.getContext
44
- - flickr.favorites.getList
45
- - flickr.favorites.getPublicList
46
- - flickr.favorites.remove
47
-
48
- # galleries
49
-
50
- - flickr.galleries.addPhoto
51
- - flickr.galleries.create
52
- - flickr.galleries.editMeta
53
- - flickr.galleries.editPhoto
54
- - flickr.galleries.editPhotos
55
- - flickr.galleries.getInfo
56
- - flickr.galleries.getList
57
- - flickr.galleries.getListForPhoto
58
- - flickr.galleries.getPhotos
59
-
60
- # groups
61
-
62
- - flickr.groups.browse
63
- - flickr.groups.getInfo
64
- - flickr.groups.search
65
-
66
- # groups.members
67
-
68
- - flickr.groups.members.getList
69
-
70
- # groups.pools
71
-
72
- - flickr.groups.pools.add
73
- - flickr.groups.pools.getContext
74
- - flickr.groups.pools.getGroups
75
- - flickr.groups.pools.getPhotos
76
- - flickr.groups.pools.remove
77
-
78
- # interestingness
79
-
80
- - flickr.interestingness.getList
81
-
82
- # machinetags
83
-
84
- - flickr.machinetags.getNamespaces
85
- - flickr.machinetags.getPairs
86
- - flickr.machinetags.getPredicates
87
- - flickr.machinetags.getRecentValues
88
- - flickr.machinetags.getValues
89
-
90
- # panda
91
-
92
- - flickr.panda.getList
93
- - flickr.panda.getPhotos
94
-
95
- # people
96
-
97
- - ~~flickr.people.findByEmail~~
98
- - ~~flickr.people.findByUsername~~
99
- - flickr.people.getGroups
100
- - ~~flickr.people.getInfo~~
101
- - flickr.people.getLimits
102
- - flickr.people.getPhotos
103
- - flickr.people.getPhotosOf
104
- - flickr.people.getPublicGroups
105
- - ~~flickr.people.getPublicPhotos~~
106
- - flickr.people.getUploadStatus
107
-
108
- # photos
109
-
110
- - ~~flickr.photos.addTags~~
111
- - ~~flickr.photos.delete~~
112
- - flickr.photos.getAllContexts
113
- - ~~flickr.photos.getContactsPhotos~~
114
- - ~~flickr.photos.getContactsPublicPhotos~~
115
- - ~~flickr.photos.getContext~~
116
- - ~~flickr.photos.getCounts~~
117
- - ~~flickr.photos.getExif~~
118
- - ~~flickr.photos.getFavorites~~
119
- - ~~flickr.photos.getInfo~~
120
- - flickr.photos.getNotInSet
121
- - flickr.photos.getPerms
122
- - flickr.photos.getRecent
123
- - ~~flickr.photos.getSizes~~
124
- - flickr.photos.getUntagged
125
- - flickr.photos.getWithGeoData
126
- - flickr.photos.getWithoutGeoData
127
- - flickr.photos.recentlyUpdated
128
- - ~~flickr.photos.removeTag~~
129
- - ~~flickr.photos.search~~
130
- - flickr.photos.setContentType
131
- - flickr.photos.setDates
132
- - flickr.photos.setMeta
133
- - flickr.photos.setPerms
134
- - flickr.photos.setSafetyLevel
135
- - flickr.photos.setTags
136
-
137
- # photos.comments
138
-
139
- - flickr.photos.comments.addComment
140
- - flickr.photos.comments.deleteComment
141
- - flickr.photos.comments.editComment
142
- - flickr.photos.comments.getList
143
- - flickr.photos.comments.getRecentForContacts
144
-
145
- # photos.geo
146
-
147
- - flickr.photos.geo.batchCorrectLocation
148
- - flickr.photos.geo.correctLocation
149
- - flickr.photos.geo.getLocation
150
- - flickr.photos.geo.getPerms
151
- - flickr.photos.geo.photosForLocation
152
- - flickr.photos.geo.removeLocation
153
- - flickr.photos.geo.setContext
154
- - flickr.photos.geo.setLocation
155
- - flickr.photos.geo.setPerms
156
-
157
- # photos.licenses
158
-
159
- - ~~flickr.photos.licenses.getInfo~~
160
- - flickr.photos.licenses.setLicense
161
-
162
- # photos.notes
163
-
164
- - flickr.photos.notes.add
165
- - flickr.photos.notes.delete
166
- - flickr.photos.notes.edit
167
-
168
- # photos.people
169
-
170
- - flickr.photos.people.add
171
- - flickr.photos.people.delete
172
- - flickr.photos.people.deleteCoords
173
- - flickr.photos.people.editCoords
174
- - flickr.photos.people.getList
175
-
176
- # photos.suggestions
177
-
178
- - flickr.photos.suggestions.approveSuggestion
179
- - flickr.photos.suggestions.getList
180
- - flickr.photos.suggestions.rejectSuggestion
181
- - flickr.photos.suggestions.removeSuggestion
182
- - flickr.photos.suggestions.suggestLocation
183
-
184
- # photos.transform
185
-
186
- - flickr.photos.transform.rotate
187
-
188
- # photos.upload
189
-
190
- - ~~flickr.photos.upload.checkTickets~~
191
-
192
- # photosets
193
-
194
- - flickr.photosets.addPhoto
195
- - flickr.photosets.create
196
- - flickr.photosets.delete
197
- - flickr.photosets.editMeta
198
- - flickr.photosets.editPhotos
199
- - flickr.photosets.getContext
200
- - ~~flickr.photosets.getInfo~~
201
- - ~~flickr.photosets.getList~~
202
- - ~~flickr.photosets.getPhotos~~
203
- - flickr.photosets.orderSets
204
- - flickr.photosets.removePhoto
205
- - flickr.photosets.removePhotos
206
- - flickr.photosets.reorderPhotos
207
- - flickr.photosets.setPrimaryPhoto
208
-
209
- # photosets.comments
210
-
211
- - flickr.photosets.comments.addComment
212
- - flickr.photosets.comments.deleteComment
213
- - flickr.photosets.comments.editComment
214
- - flickr.photosets.comments.getList
215
-
216
- # places
217
-
218
- - flickr.places.find
219
- - flickr.places.findByLatLon
220
- - flickr.places.getChildrenWithPhotosPublic
221
- - flickr.places.getInfo
222
- - flickr.places.getInfoByUrl
223
- - flickr.places.getPlaceTypes
224
- - flickr.places.getShapeHistory
225
- - flickr.places.getTopPlacesList
226
- - flickr.places.placesForBoundingBox
227
- - flickr.places.placesForContacts
228
- - flickr.places.placesForTags
229
- - flickr.places.placesForUser
230
- - flickr.places.resolvePlaceId
231
- - flickr.places.resolvePlaceURL
232
- - flickr.places.tagsForPlace
233
-
234
- # prefs
235
-
236
- - flickr.prefs.getContentType
237
- - flickr.prefs.getGeoPerms
238
- - flickr.prefs.getHidden
239
- - flickr.prefs.getPrivacy
240
- - flickr.prefs.getSafetyLevel
241
-
242
- # push
243
-
244
- - flickr.push.getSubscriptions
245
- - flickr.push.getTopics
246
- - flickr.push.subscribe
247
- - flickr.push.unsubscribe
248
-
249
- # reflection
250
-
251
- - flickr.reflection.getMethodInfo
252
- - flickr.reflection.getMethods
253
-
254
- # stats
255
-
256
- - flickr.stats.getCollectionDomains
257
- - flickr.stats.getCollectionReferrers
258
- - flickr.stats.getCollectionStats
259
- - flickr.stats.getCSVFiles
260
- - flickr.stats.getPhotoDomains
261
- - flickr.stats.getPhotoReferrers
262
- - flickr.stats.getPhotosetDomains
263
- - flickr.stats.getPhotosetReferrers
264
- - flickr.stats.getPhotosetStats
265
- - flickr.stats.getPhotoStats
266
- - flickr.stats.getPhotostreamDomains
267
- - flickr.stats.getPhotostreamReferrers
268
- - flickr.stats.getPhotostreamStats
269
- - flickr.stats.getPopularPhotos
270
- - flickr.stats.getTotalViews
271
-
272
- # tags
273
-
274
- - flickr.tags.getClusterPhotos
275
- - flickr.tags.getClusters
276
- - flickr.tags.getHotList
277
- - flickr.tags.getListPhoto
278
- - flickr.tags.getListUser
279
- - flickr.tags.getListUserPopular
280
- - flickr.tags.getListUserRaw
281
- - flickr.tags.getMostFrequentlyUsed
282
- - flickr.tags.getRelated
283
-
284
- # test
285
-
286
- - flickr.test.echo
287
- - flickr.test.login
288
- - flickr.test.null
289
-
290
- # urls
291
-
292
- - flickr.urls.getGroup
293
- - flickr.urls.getUserPhotos
294
- - flickr.urls.getUserProfile
295
- - flickr.urls.lookupGallery
296
- - flickr.urls.lookupGroup
297
- - flickr.urls.lookupUser