vore 0.2.1-x86_64-darwin → 0.2.3-x86_64-darwin

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: 31497cb9cec566256acca79e43bfb5b6fe8791bea446bba60ca895f2be3ab91b
4
- data.tar.gz: 2252352ba0f823215117c143d0608431bfd6e0037f9b122f6711c191dc7f99c2
3
+ metadata.gz: 29d98a8f9581f5effc5c5ec76b1eaa4878a81876350126848fda82e73eba2a12
4
+ data.tar.gz: e29a8806131f0ce5ef176e048b3e75d1dee90a5bfab0f244a6e1f401e7a749d3
5
5
  SHA512:
6
- metadata.gz: a0f51ccfc30cb95ff87b6275c033b343ca7c07994f9937fad18a670d8973dd2c0d2db8c40f5849d2e32a372c1e755e97b3489b46532bd9c0317e7bfdc88786e0
7
- data.tar.gz: 9517a87119025f30bdb105fa89440990ec260b32db10e497a6775271fec547358a4552edf6033508d27225a12427bd61272b13e0585824802c4490d7187173de
6
+ metadata.gz: f82525deb3f2555eeca00d562b46ee8816f7dbd85dce3b705e30b1daa4d40569605159300fe6c001e67779c1ebcb837065dd04e71a55f26a1e9fa1abb4d19f8a
7
+ data.tar.gz: 7d2d633b9977dfd716547b330ecb84a77e989a57aeae029a6270cc7263269038439d5f6663314a53a1d5be05bb050b8ec26ffc486f351377f272caff061366ff
data/exe/vore-spider CHANGED
Binary file
data/lib/vore/crawler.rb CHANGED
@@ -31,6 +31,7 @@ module Vore
31
31
 
32
32
  output = %x(#{@executable} \
33
33
  --user-agent #{user_agent} \
34
+ --delay 3000 \
34
35
  --url #{website} \
35
36
  download \
36
37
  -t \
@@ -38,12 +39,25 @@ module Vore
38
39
 
39
40
  Vore.logger.info("Vore finished crawling #{website}: #{output}")
40
41
 
42
+ results = {
43
+ pages_visited: 0,
44
+ pages_unprocessed: 0,
45
+ unprocessed_pages: [],
46
+ }
47
+
41
48
  Dir.glob(File.join(output_dir, "**", "*")).each do |path|
42
49
  next unless File.file?(path)
43
50
 
44
51
  html_file = File.read(path).force_encoding("UTF-8")
45
52
  rewritten_html_file = @selma.rewrite(html_file)
46
53
 
54
+ results[:pages_visited] += 1
55
+ if rewritten_html_file.empty?
56
+ results[:pages_unprocessed] += 1
57
+ results[:unprocessed_pages] << path
58
+ next
59
+ end
60
+
47
61
  # drops the first 3 parts of the path, which are "tmp", "vore", and the site name
48
62
  url_path = path.split(FILE_SEPERATOR)[3..].join("/")
49
63
 
@@ -58,6 +72,8 @@ module Vore
58
72
  ensure
59
73
  File.delete(path) if File.file?(path)
60
74
  end
75
+
76
+ results
61
77
  end
62
78
 
63
79
  # def crawl(site, block)
@@ -19,7 +19,13 @@ module Vole
19
19
  end
20
20
 
21
21
  def handle_element(element)
22
- if element.tag_name == "pre" || element.tag_name == "code" || element.tag_name == "script" || element.tag_name == "form"
22
+ if element.tag_name == "pre" ||
23
+ element.tag_name == "code" ||
24
+ element.tag_name == "form" ||
25
+ element.tag_name == "style" ||
26
+ element.tag_name == "noscript" ||
27
+ element.tag_name == "script" ||
28
+ element.tag_name == "svg"
23
29
  element.remove
24
30
  elsif element.tag_name == "title"
25
31
  @within_title = true
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.1"
4
+ VERSION = "0.2.3"
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.1
4
+ version: 0.2.3
5
5
  platform: x86_64-darwin
6
6
  authors:
7
7
  - Garen J. Torikian