image-dumper 0.5.4.2 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/dumper +5 -1
- data/lib/dumper/profiles/teca.rb +35 -0
- data/lib/dumper/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bb0916cbaf373d4b57cf666146ba1d04db68835
|
4
|
+
data.tar.gz: d0dd26d401d89d3b5173653663d9f54fe6a0275b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 936f144bd3c4c50d566e45a145749920ff14f28be43f8b28b95baabdb3958bdeb2286c74133944703c6d37b6e6cffc1b8d07f4dcd30308e16db65a716ba02da9
|
7
|
+
data.tar.gz: 328ea9e69894a4529cb763ee3103b218de43bac5e3da1869f0cffe63188e678a503ad244e43ca65dc58eeb16bf6ddd8faf4ea3529b9770170e915dd37c72fa99
|
data/bin/dumper
CHANGED
@@ -62,6 +62,10 @@ OptionParser.new do |o|
|
|
62
62
|
options[:path] << path
|
63
63
|
end
|
64
64
|
|
65
|
+
o.on '-r', '--profile PROFILE', 'Use the given profile' do |profile|
|
66
|
+
options[:profile] = profile
|
67
|
+
end
|
68
|
+
|
65
69
|
o.on '-x', '--xpath XPATH', 'Custom xpath' do |xpath|
|
66
70
|
options[:xpath] = xpath
|
67
71
|
end
|
@@ -84,7 +88,7 @@ end
|
|
84
88
|
options[:url].each_with_index { |url, i|
|
85
89
|
begin
|
86
90
|
|
87
|
-
host = URI.parse(url).host.split(?.)[-2]
|
91
|
+
host = options.has_key?(:profile) ? options[:profile] : URI.parse(url).host.split(?.)[-2]
|
88
92
|
Dir.mkdir(options[:path][i]) unless File.directory? options[:path][i]
|
89
93
|
|
90
94
|
if Dumper::Profiles::list.include? host.gsub(?-, ?_)
|
@@ -0,0 +1,35 @@
|
|
1
|
+
#--
|
2
|
+
# Copyright(C) 2013 Giovanni Capuano <webmaster@giovannicapuano.net>
|
3
|
+
#
|
4
|
+
# This file is part of Dumper.
|
5
|
+
#
|
6
|
+
# Dumper is free software: you can redistribute it and/or modify
|
7
|
+
# it under the terms of the GNU General Public License as published by
|
8
|
+
# the Free Software Foundation, either version 3 of the License, or
|
9
|
+
# (at your option) any later version.
|
10
|
+
#
|
11
|
+
# Dumper is distributed in the hope that it will be useful,
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
14
|
+
# GNU General Public License for more details.
|
15
|
+
#
|
16
|
+
# You should have received a copy of the GNU General Public License
|
17
|
+
# along with Dumper. If not, see <http://www.gnu.org/licenses/>.
|
18
|
+
#++
|
19
|
+
|
20
|
+
module Dumper
|
21
|
+
module Profiles
|
22
|
+
|
23
|
+
def self.get_teca(url, path)
|
24
|
+
url = url.split('index').first
|
25
|
+
Nokogiri::HTML(open(url)).xpath('//a/@href').each { |p|
|
26
|
+
self.get(path, "#{url}/#{p}") if p.to_s =~ /.\.(png|bmp|jpeg|jpg|gif|tiff)$/i
|
27
|
+
}
|
28
|
+
end
|
29
|
+
|
30
|
+
def self.info_teca
|
31
|
+
{ :from => false, :to => false }
|
32
|
+
end
|
33
|
+
|
34
|
+
end
|
35
|
+
end
|
data/lib/dumper/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: image-dumper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giovanni Capuano
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- lib/dumper/profiles/multiplayer.rb
|
78
78
|
- lib/dumper/profiles/redblow.rb
|
79
79
|
- lib/dumper/profiles/sankakucomplex.rb
|
80
|
+
- lib/dumper/profiles/teca.rb
|
80
81
|
- lib/dumper/profiles/wallpaperhere.rb
|
81
82
|
- lib/dumper/profiles/yande.rb
|
82
83
|
- lib/dumper/utils.rb
|