vore 0.2.1-x86_64-linux → 0.2.2-x86_64-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: 3195a81c9fa1fa0fe6fa7020a88b364b31000dd777fb02f032857506cb21b161
4
- data.tar.gz: e3e1d7f7f8077c8457a511c660349df50b5ced2401590146a7b21127ed2b8435
3
+ metadata.gz: c27c900fcf6aa58b097af96ed54fa00f9ec6457f96039328dd5745dd0be8e5b2
4
+ data.tar.gz: 97e9e59e081538976e39dad93d5a70638a487bfa5ed81f321a0eb73a505879de
5
5
  SHA512:
6
- metadata.gz: 3832f2a5545fc2cf537bad43c1fccb71a6e0e0acf11bd4efcd1b4d172bb49a05b2f667182b5493af62b3a5e9110507618e0b94995eb0741a99be3d8dd13386e8
7
- data.tar.gz: 66b48a21c7ae26152f901af9878847600e09c9e86a352984908f76de3175ab4353e55d01815809cd5b1ebb99a6c2551df8b60795375195b67dfaaa74e7faf6af
6
+ metadata.gz: 3b95950fef4cf650e97430ec7514b09aa9e2ef6009e8cf2589e870fe150e703cd6b5477278cea4ab99c3ffd429d126592a0c8c9f283f6369fa58f04fab8a7ced
7
+ data.tar.gz: 742ca3d1ad27ede5a8a2a4bdc469e438fa2113c65b7502f3a33dc542e272b3eddac9a91b79c5e130757fbe20ee6bb9809afe83b43a008ecf6fa7e0379536ef30
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.2"
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.2
5
5
  platform: x86_64-linux
6
6
  authors:
7
7
  - Garen J. Torikian