vore 0.2.8-arm64-linux → 0.3.0-arm64-linux

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
  SHA256:
3
- metadata.gz: 0f77381da3968a295e7b13edb86877a2d94646c9f9730bcd2e891c1bd885956a
4
- data.tar.gz: b392e9cf87a1bf80ec9b03603c6984b55c76a6da569eba836af48c090f865d5b
3
+ metadata.gz: 7c3033ea973b09cb40e841e5be9403126d3aa9acc1c82bcd6ef718086b03b397
4
+ data.tar.gz: e3fb4483dfa4b3cc0406c5e99ed623cade66f05b50204121a5325307b74a8abc
5
5
  SHA512:
6
- metadata.gz: abb134c68955daa0ef225183f2bf1563a449395cc93a4ff6bf7f8161d1fcde9e315327d3fa50bfe2081f6ab301cc869c0fd231774c5794ad34043c6093e797c1
7
- data.tar.gz: 858cdee603239b6e5c7cdbbf3538d5566ca726d08e986376d527d549d8f4bf4de8bccb325758b5449baae37575b7e954bd78c02ab816875589c5273c66b11ea1
6
+ metadata.gz: 2cde527795fe34275c0a8ad93218d38674b01197eae21337d898809eb7da05d38fbdeaa405082cfd4d4e1ba2184703190f337544aa979f640830a0172e5ee732
7
+ data.tar.gz: 5a867187798343e9ba6736937ef54f9feee35537421652969d4a3558c538d183ca422a25fc1b9d4f909e7e99e9a113262f257915c0f9f000e51afe553149177d
@@ -5,5 +5,9 @@ module Vole
5
5
  DEFAULT_SANITIZATION_CONFIG = Selma::Sanitizer::Config::RELAXED.dup.merge({
6
6
  allow_doctype: false,
7
7
  })
8
+
9
+ DEFAULT_OPTIONS = {
10
+ delay: 3500,
11
+ }
8
12
  end
9
13
  end
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, @output_dir)
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, output_dir)
90
+ def run_command(website, delay: 3500)
90
91
  %x(#{@executable} \
91
92
  --user-agent #{user_agent} \
92
- --delay 3500 \
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Vore
4
- VERSION = "0.2.8"
4
+ VERSION = "0.3.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vore
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.8
4
+ version: 0.3.0
5
5
  platform: arm64-linux
6
6
  authors:
7
7
  - Garen J. Torikian