vore 0.2.8-x86_64-linux → 0.3.0-x86_64-linux
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/exe/vore-spider +0 -0
- data/lib/vore/configuration.rb +4 -0
- data/lib/vore/crawler.rb +6 -5
- data/lib/vore/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5fa0065651385809a53579488f9985cc3332197d4fa9818508859bb24274a16b
|
4
|
+
data.tar.gz: a0754878a08d651215dd5df40220e3002255ef65fedcb365e0605ff228db27fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 48298f9bf6de3e76b443a4ea46fa0adc687e4a39b90fc94ae6a97e0ce0153c6e983e292af0c8d6a53dcb44e94b8ecba94f8adc75fe5ce8cd7857e947ab113795
|
7
|
+
data.tar.gz: 404712a662f24fff36346998e791cfac7c9ac44661005209f0a2a65b38146f0233dfcdc9cfc115c5772340d310d085dbadbca8766201fad810843359ccff1c98
|
data/exe/vore-spider
CHANGED
Binary file
|
data/lib/vore/configuration.rb
CHANGED
data/lib/vore/crawler.rb
CHANGED
@@ -12,7 +12,7 @@ module Vore
|
|
12
12
|
|
13
13
|
# Creates a crawler
|
14
14
|
# denylist: Sets a denylist filter, allows a regexp, string or array of either to be matched.
|
15
|
-
def initialize(denylist: /a^/, sanitization_config: Vole::Configuration::DEFAULT_SANITIZATION_CONFIG)
|
15
|
+
def initialize(denylist: /a^/, sanitization_config: Vole::Configuration::DEFAULT_SANITIZATION_CONFIG, options: Vole::Configuration::DEFAULT_OPTIONS)
|
16
16
|
@denylist_regexp = Regexp.union(denylist)
|
17
17
|
|
18
18
|
@content_extractor = Vole::Handlers::ContentExtractor.new
|
@@ -20,6 +20,7 @@ module Vore
|
|
20
20
|
ext = PLATFORM.include?("windows") ? ".exe" : ""
|
21
21
|
@executable = File.expand_path([__FILE__, "..", "..", "..", "exe", "vore-spider#{ext}"].join(FILE_SEPERATOR))
|
22
22
|
@parent_output_dir = "tmp/vore"
|
23
|
+
@options = options
|
23
24
|
|
24
25
|
return if File.exist?(@executable)
|
25
26
|
|
@@ -31,7 +32,7 @@ module Vore
|
|
31
32
|
@output_dir = "#{@parent_output_dir}/#{website.gsub(/[^a-zA-Z0-9]/, "_").squeeze("_")}"
|
32
33
|
Vore.logger.info("Vore started crawling #{website}, outputting to #{output_dir}")
|
33
34
|
|
34
|
-
output = run_command(website, @
|
35
|
+
output = run_command(website, delay: @options[:delay])
|
35
36
|
|
36
37
|
Vore.logger.info("Vore finished crawling #{website}: #{output}")
|
37
38
|
|
@@ -86,14 +87,14 @@ module Vore
|
|
86
87
|
# crawl_site(site)
|
87
88
|
# end
|
88
89
|
|
89
|
-
def run_command(website,
|
90
|
+
def run_command(website, delay: 3500)
|
90
91
|
%x(#{@executable} \
|
91
92
|
--user-agent #{user_agent} \
|
92
|
-
--delay
|
93
|
+
--delay #{delay} \
|
93
94
|
--url #{website} \
|
94
95
|
download \
|
95
96
|
-t \
|
96
|
-
#{output_dir})
|
97
|
+
#{@output_dir})
|
97
98
|
end
|
98
99
|
|
99
100
|
def user_agent
|
data/lib/vore/version.rb
CHANGED