flickr_airlift 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/flickr_uplift +2 -0
- data/lib/flickr_airlift.rb +6 -3
- metadata +3 -3
data/bin/flickr_uplift
CHANGED
data/lib/flickr_airlift.rb
CHANGED
@@ -47,14 +47,17 @@ module FlickrAirlift
|
|
47
47
|
def self.upload(relative_url)
|
48
48
|
establish_session("write")
|
49
49
|
image_file_names = Dir.entries(".").find_all{ |file_name| file_name.include?(".jpg") || file_name.include?(".jpeg") || file_name.include?(".gif") || file_name.include?(".png") }
|
50
|
-
|
50
|
+
uploaded_ids = []
|
51
51
|
puts "Uploading #{image_file_names.length} files:"
|
52
52
|
sleep 1
|
53
53
|
image_file_names.each_with_index do |file_name, index|
|
54
54
|
puts " Uploading (#{index+1} of #{image_file_names.length}): #{file_name}"
|
55
|
-
flickr.upload_photo
|
55
|
+
uploaded_ids << flickr.upload_photo(File.join(relative_url, file_name), :title => file_name.split(".").first)
|
56
56
|
end
|
57
|
-
|
57
|
+
puts "...DONE!"
|
58
|
+
edit_url = "http://www.flickr.com/photos/upload/edit/?ids=#{uploaded_ids.join(',')}"
|
59
|
+
|
60
|
+
system("which open") ? system("open '#{edit_url}'") : puts(" Go to #{edit_url} to edit your photos more")
|
58
61
|
end
|
59
62
|
|
60
63
|
def self.establish_session(permission = "read")
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flickr_airlift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 6
|
10
|
+
version: 0.0.6
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Stephen Schor
|