vore 0.2.6-x86_64-linux → 0.2.8-x86_64-linux
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/vore-spider +0 -0
- data/lib/vore/crawler.rb +14 -9
- data/lib/vore/handlers/content_extractor.rb +0 -1
- 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: 322dfb93cbfeae7bdf008ed00e0c7ac67affa00d787bd18fc483c3fe583c9215
|
4
|
+
data.tar.gz: d96c5a555ae20af0c4c967539256a528b8914c49ffe3322fc286d3f7684c1355
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bc438087f76029e4af3a9a28f25ac35800b72022299c63ecb57b3ddfccc96e17c625cad4a02d7e7209d7ac2123efa235163eb5bfa74f75d7105592c83dbc32db
|
7
|
+
data.tar.gz: 2874256c99d57c2269e04b604e716c00f3eba0bb7c287f11a2b96f5f0a58bd812a9d1740da419839c0e1000e96bea36c8f4e4bc130700ddb07293c3c9ecb26e5
|
data/exe/vore-spider
CHANGED
Binary file
|
data/lib/vore/crawler.rb
CHANGED
@@ -8,6 +8,8 @@ module Vore
|
|
8
8
|
PLATFORM = [:cpu, :os].map { |m| Gem::Platform.local.send(m) }.join("-")
|
9
9
|
FILE_SEPERATOR = PLATFORM.include?("windows") ? File::ALT_SEPARATOR : File::SEPARATOR
|
10
10
|
|
11
|
+
attr_reader :output_dir
|
12
|
+
|
11
13
|
# Creates a crawler
|
12
14
|
# denylist: Sets a denylist filter, allows a regexp, string or array of either to be matched.
|
13
15
|
def initialize(denylist: /a^/, sanitization_config: Vole::Configuration::DEFAULT_SANITIZATION_CONFIG)
|
@@ -26,16 +28,10 @@ module Vore
|
|
26
28
|
end
|
27
29
|
|
28
30
|
def scrape_each_page(website, &block)
|
29
|
-
output_dir = "#{@parent_output_dir}/#{website.gsub(/[^a-zA-Z0-9]/, "_").squeeze("_")}"
|
31
|
+
@output_dir = "#{@parent_output_dir}/#{website.gsub(/[^a-zA-Z0-9]/, "_").squeeze("_")}"
|
30
32
|
Vore.logger.info("Vore started crawling #{website}, outputting to #{output_dir}")
|
31
33
|
|
32
|
-
output =
|
33
|
-
--user-agent #{user_agent} \
|
34
|
-
--delay 3500 \
|
35
|
-
--url #{website} \
|
36
|
-
download \
|
37
|
-
-t \
|
38
|
-
#{output_dir})
|
34
|
+
output = run_command(website, @output_dir)
|
39
35
|
|
40
36
|
Vore.logger.info("Vore finished crawling #{website}: #{output}")
|
41
37
|
|
@@ -54,7 +50,6 @@ module Vore
|
|
54
50
|
rewritten_html_file = ""
|
55
51
|
|
56
52
|
if html_file.empty?
|
57
|
-
Vore.logger.warn("HTML file empty: #{path}")
|
58
53
|
results[:pages_unprocessed] += 1
|
59
54
|
results[:unprocessed_pages] << path
|
60
55
|
next
|
@@ -91,6 +86,16 @@ module Vore
|
|
91
86
|
# crawl_site(site)
|
92
87
|
# end
|
93
88
|
|
89
|
+
def run_command(website, output_dir)
|
90
|
+
%x(#{@executable} \
|
91
|
+
--user-agent #{user_agent} \
|
92
|
+
--delay 3500 \
|
93
|
+
--url #{website} \
|
94
|
+
download \
|
95
|
+
-t \
|
96
|
+
#{output_dir})
|
97
|
+
end
|
98
|
+
|
94
99
|
def user_agent
|
95
100
|
"'Mozilla/5.0 (compatible; Vore/#{Vore::VERSION}; +https://github.com/gjtorikian/vore)'"
|
96
101
|
end
|
data/lib/vore/version.rb
CHANGED