nokaya 0.0.8 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/README.md +58 -50
- data/bin/nokaya +0 -0
- data/lib/nokaya.rb +0 -2
- data/lib/nokaya/adn.rb +35 -0
- data/lib/nokaya/app.rb +74 -110
- data/lib/nokaya/basic.rb +32 -0
- data/lib/nokaya/deviantart.rb +34 -0
- data/lib/nokaya/favd.rb +35 -0
- data/lib/nokaya/flickr_album.rb +40 -0
- data/lib/nokaya/imageshack_user.rb +40 -0
- data/lib/nokaya/imgur_album.rb +37 -0
- data/lib/nokaya/instagram.rb +32 -0
- data/lib/nokaya/movie.rb +33 -0
- data/lib/nokaya/photonet.rb +31 -0
- data/lib/nokaya/status.rb +22 -4
- data/lib/nokaya/tumblr.rb +28 -0
- data/lib/nokaya/tumblr_album.rb +42 -0
- data/lib/nokaya/version.rb +1 -1
- data/lib/nokaya/workers.rb +83 -0
- data/nokaya.gemspec +7 -12
- data/spec/nokaya_spec.rb +8 -14
- data/spec/spec_helper.rb +0 -1
- metadata +37 -97
- data/lib/nokaya/getter.rb +0 -100
- data/lib/nokaya/image.rb +0 -40
data/lib/nokaya/image.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
# encoding: utf-8
|
2
|
-
module Nokaya
|
3
|
-
class Image
|
4
|
-
|
5
|
-
def self.photo_name nokaya
|
6
|
-
path = self.out nokaya
|
7
|
-
if nokaya.options[:name]
|
8
|
-
"#{path}/#{nokaya.type.to_s}-#{nokaya.options[:name]}.jpg"
|
9
|
-
else
|
10
|
-
"#{path}/#{nokaya.type.to_s}-#{Time.now.to_i}.jpg"
|
11
|
-
end
|
12
|
-
end
|
13
|
-
|
14
|
-
def self.save_image path, link
|
15
|
-
content = self.get_image link
|
16
|
-
f = File.new(path, "wb")
|
17
|
-
f.puts(content)
|
18
|
-
f.close
|
19
|
-
end
|
20
|
-
|
21
|
-
def self.get_image img_link
|
22
|
-
begin
|
23
|
-
open(img_link).read
|
24
|
-
rescue
|
25
|
-
abort Status.no_can_do
|
26
|
-
end
|
27
|
-
end
|
28
|
-
|
29
|
-
private
|
30
|
-
|
31
|
-
def self.out nokaya
|
32
|
-
if nokaya.options[:output]
|
33
|
-
nokaya.options[:output]
|
34
|
-
else
|
35
|
-
Dir.home + "/Downloads"
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
end
|
40
|
-
end
|