deadfinder 1.4.1 → 1.4.3
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/lib/deadfinder/logger.rb +4 -0
- data/lib/deadfinder/version.rb +1 -1
- data/lib/deadfinder.rb +12 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 817a9afe1a982ecd1f68da8f8fff483283d9c54c4b01c6aba8f49aa4dc930e89
|
4
|
+
data.tar.gz: b9923c6e9f2fd21a9d568c5880d55a796a4c8bf6402b19c3b937b63e1e9eaae5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cec0f877dd6313fe97fedb5a68ccf04e580da393fdb599b757305deca958eefec59d0f844691d98ac76a820535d5373eba9e720002b3c047a54a48ca0adbbbab
|
7
|
+
data.tar.gz: e68ba75213ce56b658c23f92a49c4794ebb944bf082a03cd09ed8e8ece287f126f7fa8358caf2a799c3ccc7ba7502004623585b89973136d5c325ef1669b1e8d
|
data/lib/deadfinder/logger.rb
CHANGED
data/lib/deadfinder/version.rb
CHANGED
data/lib/deadfinder.rb
CHANGED
@@ -12,9 +12,9 @@ require 'sitemap-parser'
|
|
12
12
|
require 'json'
|
13
13
|
|
14
14
|
Channel = Concurrent::Channel
|
15
|
-
|
16
|
-
|
17
|
-
|
15
|
+
CACHE_SET = Concurrent::Map.new
|
16
|
+
CACHE_QUE = Concurrent::Map.new
|
17
|
+
OUTPUT = {}
|
18
18
|
|
19
19
|
class DeadFinderRunner
|
20
20
|
def default_options
|
@@ -72,12 +72,12 @@ class DeadFinderRunner
|
|
72
72
|
|
73
73
|
def worker(_id, jobs, results, target, options)
|
74
74
|
jobs.each do |j|
|
75
|
-
if
|
76
|
-
Logger.found "[404 Not Found] #{j}" unless
|
75
|
+
if CACHE_SET[j]
|
76
|
+
Logger.found "[404 Not Found] #{j}" unless CACHE_QUE[j]
|
77
77
|
else
|
78
|
-
|
78
|
+
CACHE_SET[j] = true
|
79
79
|
begin
|
80
|
-
|
80
|
+
CACHE_QUE[j] = true
|
81
81
|
uri = URI.parse(j)
|
82
82
|
|
83
83
|
# Create HTTP request with timeout and headers
|
@@ -92,9 +92,9 @@ class DeadFinderRunner
|
|
92
92
|
|
93
93
|
if status_code >= 400 || (status_code >= 300 && options['include30x'])
|
94
94
|
Logger.found "[#{status_code} #{response.message}] #{j}"
|
95
|
-
|
96
|
-
|
97
|
-
|
95
|
+
CACHE_QUE[j] = false
|
96
|
+
OUTPUT[target] ||= []
|
97
|
+
OUTPUT[target] << j
|
98
98
|
end
|
99
99
|
rescue StandardError => e
|
100
100
|
Logger.verbose "[#{e}] #{j}" if options['verbose']
|
@@ -169,7 +169,8 @@ def run_sitemap(sitemap_url, options)
|
|
169
169
|
end
|
170
170
|
|
171
171
|
def gen_output(options)
|
172
|
-
|
172
|
+
output_data = OUTPUT.to_h
|
173
|
+
File.write(options['output'], JSON.pretty_generate(output_data)) unless options['output'].empty?
|
173
174
|
end
|
174
175
|
|
175
176
|
class DeadFinder < Thor
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deadfinder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.4.
|
4
|
+
version: 1.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- hahwul
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|