flickr_airlift 0.4.1 → 0.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +1 -1
- data/flickr_airlift.gemspec +2 -3
- data/lib/flickr_airlift/version.rb +1 -1
- data/lib/flickr_airlift.rb +4 -40
- metadata +8 -24
data/LICENSE.txt
CHANGED
data/flickr_airlift.gemspec
CHANGED
@@ -18,9 +18,8 @@ Gem::Specification.new do |gem|
|
|
18
18
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
19
19
|
gem.require_paths = ["lib"]
|
20
20
|
|
21
|
-
gem.add_dependency
|
22
|
-
gem.add_dependency
|
23
|
-
gem.add_dependency('highline', '1.6.11')
|
21
|
+
gem.add_dependency 'highline', '1.6.11'
|
22
|
+
gem.add_dependency 'flickr_authentication', '0.0.1'
|
24
23
|
|
25
24
|
gem.rubyforge_project = 'nowarning'
|
26
25
|
|
data/lib/flickr_airlift.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
1
|
require "flickr_airlift/version"
|
2
2
|
require "flickr_airlift/downloader"
|
3
|
-
require '
|
3
|
+
require 'flickr_authentication'
|
4
4
|
require 'net/http'
|
5
5
|
require 'cgi'
|
6
|
-
require 'launchy'
|
7
6
|
require 'highline/import'
|
8
7
|
require 'yaml'
|
9
8
|
|
@@ -13,6 +12,7 @@ module FlickrAirlift
|
|
13
12
|
|
14
13
|
def self.download
|
15
14
|
begin
|
15
|
+
|
16
16
|
establish_session
|
17
17
|
|
18
18
|
# Prompt
|
@@ -76,44 +76,8 @@ module FlickrAirlift
|
|
76
76
|
end
|
77
77
|
|
78
78
|
def self.establish_session
|
79
|
-
|
80
|
-
|
81
|
-
FlickRaw.shared_secret = "405549bcec106815"
|
82
|
-
|
83
|
-
if File.exists?(auth_file)
|
84
|
-
|
85
|
-
data = YAML.load_file(auth_file)
|
86
|
-
|
87
|
-
begin
|
88
|
-
auth = flickr.auth.checkToken :auth_token => data["api_token"]
|
89
|
-
rescue Exception => e
|
90
|
-
puts "These was a problem with the credentials in #{auth_file}"
|
91
|
-
puts "Delete the file and try again."
|
92
|
-
exit
|
93
|
-
end
|
94
|
-
|
95
|
-
else
|
96
|
-
frob = flickr.auth.getFrob
|
97
|
-
auth_url = FlickRaw.auth_url :frob => frob, :perms => "write"
|
98
|
-
|
99
|
-
puts " "
|
100
|
-
puts "opening your browser..."
|
101
|
-
sleep 1
|
102
|
-
puts "Come back and press Enter when you are finished"
|
103
|
-
sleep 2
|
104
|
-
Launchy.open(auth_url)
|
105
|
-
|
106
|
-
STDIN.getc
|
107
|
-
|
108
|
-
# Authentication
|
109
|
-
auth = flickr.auth.getToken :frob => frob
|
110
|
-
login = flickr.test.login
|
111
|
-
|
112
|
-
puts "Writing credentials to #{auth_file}"
|
113
|
-
data = {}
|
114
|
-
data["api_token"] = auth.token
|
115
|
-
File.open(auth_file, "w"){|f| YAML.dump(data, f) }
|
116
|
-
end
|
79
|
+
fa = FlickrAuthentication.new(key: '3b2360cc04947af8cf59f51c47a6a8e4', shared_secret: '405549bcec106815', auth_file: File.join(Dir.home, ".flick_airliftrc"))
|
80
|
+
fa.authenticate
|
117
81
|
end
|
118
82
|
|
119
83
|
end
|
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.
|
4
|
+
version: 0.4.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,32 +9,16 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-07-
|
12
|
+
date: 2013-07-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
-
name:
|
16
|
-
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
|
-
requirements:
|
19
|
-
- - '='
|
20
|
-
- !ruby/object:Gem::Version
|
21
|
-
version: 0.4.0
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
|
-
requirements:
|
27
|
-
- - '='
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
version: 0.4.0
|
30
|
-
- !ruby/object:Gem::Dependency
|
31
|
-
name: flickraw
|
15
|
+
name: highline
|
32
16
|
requirement: !ruby/object:Gem::Requirement
|
33
17
|
none: false
|
34
18
|
requirements:
|
35
19
|
- - '='
|
36
20
|
- !ruby/object:Gem::Version
|
37
|
-
version:
|
21
|
+
version: 1.6.11
|
38
22
|
type: :runtime
|
39
23
|
prerelease: false
|
40
24
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -42,15 +26,15 @@ dependencies:
|
|
42
26
|
requirements:
|
43
27
|
- - '='
|
44
28
|
- !ruby/object:Gem::Version
|
45
|
-
version:
|
29
|
+
version: 1.6.11
|
46
30
|
- !ruby/object:Gem::Dependency
|
47
|
-
name:
|
31
|
+
name: flickr_authentication
|
48
32
|
requirement: !ruby/object:Gem::Requirement
|
49
33
|
none: false
|
50
34
|
requirements:
|
51
35
|
- - '='
|
52
36
|
- !ruby/object:Gem::Version
|
53
|
-
version:
|
37
|
+
version: 0.0.1
|
54
38
|
type: :runtime
|
55
39
|
prerelease: false
|
56
40
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -58,7 +42,7 @@ dependencies:
|
|
58
42
|
requirements:
|
59
43
|
- - '='
|
60
44
|
- !ruby/object:Gem::Version
|
61
|
-
version:
|
45
|
+
version: 0.0.1
|
62
46
|
description: A Command-Line tool for scraping any user's original photos OR uploading
|
63
47
|
all photos from a given directory
|
64
48
|
email:
|