flickr_airlift 0.4.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +9 -11
- data/flickr_airlift.gemspec +2 -2
- data/lib/flickr_airlift.rb +1 -24
- data/lib/flickr_airlift/version.rb +1 -1
- metadata +4 -8
- data/bin/flickr_uplift +0 -5
data/README.textile
CHANGED
@@ -19,19 +19,17 @@ h2. Usage
|
|
19
19
|
|
20
20
|
Here's an "example session":https://gist.github.com/0cd071320f022c06dc23
|
21
21
|
|
22
|
-
|
23
|
-
|
24
|
-
h1. Flickr Uplift
|
22
|
+
h1. Stored Authentication.
|
25
23
|
|
26
|
-
|
27
|
-
By default they will all be public.
|
24
|
+
Once flickr_airlift authenticates you - it stores your authentication in ~/.flick_airliftrc
|
28
25
|
|
29
|
-
|
26
|
+
------------------------------------------------------------------------------------
|
30
27
|
|
28
|
+
The @flickr_uplift@ gem was removed from this gem.
|
29
|
+
It used to upload files from an arbitrary directory.
|
30
|
+
Muddling together these two features in one gem was a weird idea to begin with.
|
31
|
+
One day I'll create a separate flickr_uplift gem.
|
32
|
+
The last version with this functionality is "0.4.3":https://github.com/nodanaonlyzuul/flickr_airlift/tree/0.4.3
|
31
33
|
Here's an "example session":https://gist.github.com/61c9b299fdbae112dc26
|
32
34
|
|
33
|
-
|
34
|
-
|
35
|
-
h1. Stored Authentication.
|
36
|
-
|
37
|
-
Once flickr_airlift authenticates you - it stores your authentication in ~/.flick_airliftrc
|
35
|
+
_This product uses the Flickr API but is not endorsed or certified by Flickr._
|
data/flickr_airlift.gemspec
CHANGED
@@ -9,8 +9,8 @@ Gem::Specification.new do |gem|
|
|
9
9
|
gem.authors = ["nodanaonlyzuul"]
|
10
10
|
gem.email = ["beholdthepanda@gmail.com"]
|
11
11
|
gem.license = 'MIT'
|
12
|
-
gem.description = "A Command-Line tool for scraping any user's original photos
|
13
|
-
gem.summary = "A Command-Line tool for scraping any user's original photos
|
12
|
+
gem.description = "A Command-Line tool for scraping any user's original photos."
|
13
|
+
gem.summary = "A Command-Line tool for scraping any user's original photos."
|
14
14
|
gem.homepage = "https://github.com/nodanaonlyzuul/flickr_airlift"
|
15
15
|
|
16
16
|
gem.files = `git ls-files`.split($/)
|
data/lib/flickr_airlift.rb
CHANGED
@@ -4,12 +4,9 @@ require 'flickr_authentication'
|
|
4
4
|
require 'net/http'
|
5
5
|
require 'cgi'
|
6
6
|
require 'highline/import'
|
7
|
-
require 'yaml'
|
8
7
|
|
9
8
|
module FlickrAirlift
|
10
9
|
|
11
|
-
UPLOADABLE_FORMATS = [".jpg", ".jpeg", ".gif", ".png", ".mov", ".avi"]
|
12
|
-
|
13
10
|
def self.download
|
14
11
|
begin
|
15
12
|
|
@@ -47,7 +44,7 @@ module FlickrAirlift
|
|
47
44
|
end
|
48
45
|
end
|
49
46
|
|
50
|
-
menu.choice("Quit")
|
47
|
+
menu.choice("Quit") { exit }
|
51
48
|
end
|
52
49
|
|
53
50
|
rescue FlickRaw::FailedResponse => e
|
@@ -55,26 +52,6 @@ module FlickrAirlift
|
|
55
52
|
end
|
56
53
|
end
|
57
54
|
|
58
|
-
def self.upload(relative_url = ".")
|
59
|
-
establish_session
|
60
|
-
|
61
|
-
image_file_names = Dir.entries(relative_url).find_all{ |file_name| UPLOADABLE_FORMATS.any?{ |extension| file_name.downcase.include?(extension)} }
|
62
|
-
uploaded_ids = []
|
63
|
-
|
64
|
-
puts "Uploading #{image_file_names.length} files:"
|
65
|
-
sleep 1
|
66
|
-
|
67
|
-
image_file_names.each_with_index do |file_name, index|
|
68
|
-
puts " Uploading (#{index+1} of #{image_file_names.length}): #{file_name}"
|
69
|
-
uploaded_ids << flickr.upload_photo(File.join(relative_url, file_name), :title => file_name.split(".").first)
|
70
|
-
end
|
71
|
-
|
72
|
-
puts "...DONE!"
|
73
|
-
edit_url = "http://www.flickr.com/photos/upload/edit/?ids=#{uploaded_ids.join(',')}"
|
74
|
-
|
75
|
-
Launchy.open(edit_url)
|
76
|
-
end
|
77
|
-
|
78
55
|
def self.establish_session
|
79
56
|
fa = FlickrAuthentication.new(key: '3b2360cc04947af8cf59f51c47a6a8e4', shared_secret: '405549bcec106815', auth_file: File.join(Dir.home, ".flick_airliftrc"))
|
80
57
|
fa.authenticate
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flickr_airlift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-08-12 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: highline
|
@@ -43,13 +43,11 @@ dependencies:
|
|
43
43
|
- - '='
|
44
44
|
- !ruby/object:Gem::Version
|
45
45
|
version: 0.0.2
|
46
|
-
description: A Command-Line tool for scraping any user's original photos
|
47
|
-
all photos from a given directory
|
46
|
+
description: A Command-Line tool for scraping any user's original photos.
|
48
47
|
email:
|
49
48
|
- beholdthepanda@gmail.com
|
50
49
|
executables:
|
51
50
|
- flickr_airlift
|
52
|
-
- flickr_uplift
|
53
51
|
extensions: []
|
54
52
|
extra_rdoc_files: []
|
55
53
|
files:
|
@@ -59,7 +57,6 @@ files:
|
|
59
57
|
- README.textile
|
60
58
|
- Rakefile
|
61
59
|
- bin/flickr_airlift
|
62
|
-
- bin/flickr_uplift
|
63
60
|
- flickr_airlift.gemspec
|
64
61
|
- lib/flickr_airlift.rb
|
65
62
|
- lib/flickr_airlift/downloader.rb
|
@@ -88,6 +85,5 @@ rubyforge_project: nowarning
|
|
88
85
|
rubygems_version: 1.8.24
|
89
86
|
signing_key:
|
90
87
|
specification_version: 3
|
91
|
-
summary: A Command-Line tool for scraping any user's original photos
|
92
|
-
all photos from a given directory
|
88
|
+
summary: A Command-Line tool for scraping any user's original photos.
|
93
89
|
test_files: []
|