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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6974ffcabb5cb92bf8ec7dcbaec484fb60cbdc32
4
- data.tar.gz: 606411203e58de11b818edb1eef79c529b59db16
3
+ metadata.gz: 8bb0916cbaf373d4b57cf666146ba1d04db68835
4
+ data.tar.gz: d0dd26d401d89d3b5173653663d9f54fe6a0275b
5
5
  SHA512:
6
- metadata.gz: 951420ac28177f8293f3cc24fdad249597adb48c4b7c9c4dee3ca3d9cb68550b33a1c802659ebc0b2047dcd231eaa5076f4f002b3216388211ebacab92a00bd0
7
- data.tar.gz: 18340f6fb9b924251a4967056768a8bdf8f8f39bcb20c069d8d4144bd26e8251d33eba912eedd8496a05dca85e62006493a95aa856fd8cb5c1875d0050a00ad3
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
@@ -19,6 +19,6 @@
19
19
 
20
20
  module Dumper
21
21
  def self.version
22
- '0.5.4.2'
22
+ '0.5.5'
23
23
  end
24
24
  end
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.2
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: 2013-12-16 00:00:00.000000000 Z
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