rmm5t-flickr_fu 0.3.4 → 0.3.5
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/VERSION.yml +1 -1
- data/lib/flickr/photo.rb +33 -24
- data/rmm5t-flickr_fu.gemspec +2 -2
- metadata +2 -2
data/VERSION.yml
CHANGED
data/lib/flickr/photo.rb
CHANGED
@@ -80,7 +80,7 @@ class Flickr::Photos::Photo
|
|
80
80
|
end
|
81
81
|
|
82
82
|
# save the current photo to the local computer
|
83
|
-
#
|
83
|
+
#
|
84
84
|
# == Params
|
85
85
|
# * filename (Required)
|
86
86
|
# name of the new file omiting the extention (ex. photo_1)
|
@@ -92,7 +92,7 @@ class Flickr::Photos::Photo
|
|
92
92
|
# :medium - 500 on longest side
|
93
93
|
# :large - 1024 on longest side (only exists for very large original images)
|
94
94
|
# :original - original image, either a jpg, gif or png, depending on source format
|
95
|
-
#
|
95
|
+
#
|
96
96
|
def save_as(filename, size = :medium)
|
97
97
|
format = size.to_sym == :original ? (self.original_format || 'jpg') : 'jpg'
|
98
98
|
filename = "#{filename}.#{format}"
|
@@ -106,18 +106,18 @@ class Flickr::Photos::Photo
|
|
106
106
|
f
|
107
107
|
end
|
108
108
|
end
|
109
|
-
|
109
|
+
|
110
110
|
# Add tags to a photo.
|
111
|
-
#
|
111
|
+
#
|
112
112
|
# Params
|
113
113
|
# * tags (Required)
|
114
114
|
# comma seperated list of tags
|
115
|
-
#
|
115
|
+
#
|
116
116
|
def add_tags(tags)
|
117
117
|
@flickr.send_request('flickr.photos.addTags', {:photo_id => self.id, :tags => tags}, :post)
|
118
118
|
true
|
119
119
|
end
|
120
|
-
|
120
|
+
|
121
121
|
# Add comment to a photo as the currently authenticated user.
|
122
122
|
#
|
123
123
|
# Params
|
@@ -128,9 +128,9 @@ class Flickr::Photos::Photo
|
|
128
128
|
@flickr.send_request('flickr.photos.comments.addComment', {:photo_id => self.id, :comment_text => message}, :post)
|
129
129
|
true
|
130
130
|
end
|
131
|
-
|
131
|
+
|
132
132
|
# Add a note to a photo. Coordinates and sizes are in pixels, based on the 500px image size shown on individual photo pages.
|
133
|
-
#
|
133
|
+
#
|
134
134
|
# Params
|
135
135
|
# * message (Required)
|
136
136
|
# The text of the note
|
@@ -142,25 +142,25 @@ class Flickr::Photos::Photo
|
|
142
142
|
# The width of the note
|
143
143
|
# * h (Required)
|
144
144
|
# The height of the note
|
145
|
-
#
|
145
|
+
#
|
146
146
|
def add_note(message, x, y, w, h)
|
147
147
|
@flickr.send_request('flickr.photos.notes.add', {:photo_id => self.id, :note_x => x, :note_y => y, :note_w => w, :note_h => h, :note_text => message}, :post)
|
148
148
|
true
|
149
149
|
end
|
150
|
-
|
150
|
+
|
151
151
|
# Rotate a photo.
|
152
|
-
#
|
152
|
+
#
|
153
153
|
# Params
|
154
154
|
# * degrees (Required)
|
155
155
|
# The amount of degrees by which to rotate the photo (clockwise) from it's current orientation. Valid values are 90, 180 and 270.
|
156
|
-
#
|
156
|
+
#
|
157
157
|
def rotate(degrees)
|
158
158
|
@flickr.send_request('flickr.photos.transform.rotate', {:photo_id => self.id, :degrees => degrees}, :post)
|
159
159
|
true
|
160
160
|
end
|
161
|
-
|
161
|
+
|
162
162
|
# return the license associated with the photo
|
163
|
-
#
|
163
|
+
#
|
164
164
|
def license
|
165
165
|
@flickr.photos.licenses[self.license_id]
|
166
166
|
end
|
@@ -187,9 +187,9 @@ class Flickr::Photos::Photo
|
|
187
187
|
end
|
188
188
|
@location = location
|
189
189
|
end
|
190
|
-
|
190
|
+
|
191
191
|
# Sets the license for a photo.
|
192
|
-
#
|
192
|
+
#
|
193
193
|
# Params
|
194
194
|
# * license_id (Required)
|
195
195
|
# The license to apply, or 0 (zero) to remove the current license.
|
@@ -197,7 +197,7 @@ class Flickr::Photos::Photo
|
|
197
197
|
@flickr.send_request('flickr.photos.licenses.setLicense', {:photo_id => self.id, :license_id => license_id}, :post)
|
198
198
|
true
|
199
199
|
end
|
200
|
-
|
200
|
+
|
201
201
|
def description # :nodoc:
|
202
202
|
attach_info
|
203
203
|
@description
|
@@ -223,15 +223,24 @@ class Flickr::Photos::Photo
|
|
223
223
|
@url_photopage
|
224
224
|
end
|
225
225
|
|
226
|
-
|
226
|
+
# Returns a list of comments for the photo
|
227
|
+
#
|
228
|
+
# Params
|
229
|
+
# * options (Optional)
|
230
|
+
# additional parameters to pass to flickr.
|
231
|
+
# :min_comment_date - Minimum date that a comment was added. The date should be in the form of a unix timestamp.
|
232
|
+
# :max_comment_date - Maximum date that a comment was added. The date should be in the form of a unix timestamp.
|
233
|
+
#
|
234
|
+
def comments(options = {})
|
227
235
|
@comments ||= begin
|
228
236
|
if @comment_count == 0
|
229
237
|
self.comments = []
|
230
238
|
else
|
231
|
-
|
232
|
-
|
239
|
+
options.merge!(:photo_id => self.id)
|
240
|
+
rsp = @flickr.send_request('flickr.photos.comments.getList', options)
|
241
|
+
|
233
242
|
self.comments = []
|
234
|
-
|
243
|
+
|
235
244
|
rsp.comments.comment.each do |comment|
|
236
245
|
self.comments << Flickr::Photos::Comment.new(:id => comment[:id],
|
237
246
|
:comment => comment.to_s,
|
@@ -239,17 +248,17 @@ class Flickr::Photos::Photo
|
|
239
248
|
:author_name => comment[:authorname],
|
240
249
|
:permalink => comment[:permalink],
|
241
250
|
:created_at => (Time.at(comment[:datecreate].to_i) rescue nil))
|
242
|
-
end
|
251
|
+
end if rsp.comments.comment
|
243
252
|
end
|
244
253
|
|
245
254
|
self.comments
|
246
255
|
end
|
247
256
|
end
|
248
|
-
|
257
|
+
|
249
258
|
def sizes # :nodoc:
|
250
259
|
@sizes ||= begin
|
251
260
|
rsp = @flickr.send_request('flickr.photos.getSizes', :photo_id => self.id)
|
252
|
-
|
261
|
+
|
253
262
|
_sizes = []
|
254
263
|
rsp.sizes.size.each do |size|
|
255
264
|
_sizes << Flickr::Photos::Size.new(:label => size[:label], :width => size[:width],
|
data/rmm5t-flickr_fu.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rmm5t-flickr_fu}
|
8
|
-
s.version = "0.3.
|
8
|
+
s.version = "0.3.5"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Ben Wyrosdick", "Maciej Bilas"]
|
12
|
-
s.date = %q{2009-10-
|
12
|
+
s.date = %q{2009-10-07}
|
13
13
|
s.description = %q{Provides a ruby interface to flickr via the REST api}
|
14
14
|
s.email = %q{ben@commonthread.com}
|
15
15
|
s.extra_rdoc_files = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmm5t-flickr_fu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Wyrosdick
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2009-10-
|
13
|
+
date: 2009-10-07 00:00:00 -04:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|