driller 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/bin/driller +41 -18
- data/lib/driller/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MDhmMmFiMzVmNTk0N2NiMjQ0MTMxZWVmMWRkZGZkODQxZmYxZjk2Ng==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDBmMzE3NWM5NjU3NWUxNjczYTk0NWMzNWNlNDVkZDAxMDFhZGI4NQ==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NWRkOTg2NDVkMTI3NWY2MGFmNDM2NGViY2MxYzRkODQ5YTc3NWM2YjE4YjU1
|
10
|
+
MmZlYTU3ZTc1NzBjNTg1N2Q0NGVlMjdjYjBiOTkzYjllYTNmNDBmYWQwNGI3
|
11
|
+
ZTAxZDNjYjA2YThkMDRhZWYzNWI0ODQ1OTkyYzI2OTY2ZGE2MzY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YTAzMWQ2N2YyZjNiZjljODM1NDFkMzczY2VjMDU3NzRmZjg1ZWZiMzhkMmJk
|
14
|
+
MGQ0M2ExNWIxNTI3MTg2ZjY2MzVkMDg1NmZlOWUwNzY1OWRlMTQ1Y2Y2MzNh
|
15
|
+
OTA4ZDkzYjY1MTY5NWVkYWI2NWZhYTlkMjdiOWZjMjlhOTg1MmI=
|
data/bin/driller
CHANGED
@@ -5,41 +5,64 @@ require 'fileutils'
|
|
5
5
|
require "rubygems"
|
6
6
|
require "anemone"
|
7
7
|
|
8
|
-
|
8
|
+
webpage = ARGV[0]
|
9
9
|
depth = ARGV[1]
|
10
10
|
|
11
|
-
Anemone.crawl(
|
11
|
+
Anemone.crawl(webpage) do |anemone|
|
12
12
|
|
13
13
|
anemone.depth_limit = depth.to_i
|
14
|
-
|
14
|
+
puts "============= Driller is now checking your website links. If any of the link returned non 200, it will be displayed here========="
|
15
15
|
anemone.focus_crawl do |page|
|
16
|
-
page.links.select { |url| url.starts_with?
|
16
|
+
page.links.select { |url| url.starts_with? webpage }
|
17
17
|
end
|
18
18
|
|
19
19
|
file = File.new('valid_pages.html', 'w')
|
20
20
|
file = File.new('broken.html', 'w')
|
21
21
|
file = File.new('slow_pages.html', 'w')
|
22
|
+
file = File.new('extremely_slow_pages.html', 'w')
|
22
23
|
|
23
24
|
anemone.on_every_page do |page|
|
24
25
|
|
25
|
-
if page.code
|
26
|
-
|
27
|
-
file.puts page.url
|
28
|
-
end
|
29
|
-
|
30
|
-
if page.code != 200 && page.code != 301
|
31
|
-
puts "=======broken======\n"
|
26
|
+
if page.code != 200
|
27
|
+
puts "=======Not 200 OK======\n"
|
32
28
|
puts page.url
|
33
|
-
|
29
|
+
puts "\n returned response code of\n"
|
30
|
+
puts page.code
|
31
|
+
puts "\n"
|
32
|
+
file = File.open('broken.html', 'a+')
|
34
33
|
file.puts page.url
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
34
|
+
file.write("\n")
|
35
|
+
file.write("Returned with response code \n")
|
36
|
+
file.write("\n")
|
37
|
+
file.puts page.code
|
38
|
+
else if
|
39
|
+
page.code == 200
|
40
|
+
file = File.open('valid_pages.html', 'a+')
|
41
|
+
file.puts page.url
|
42
|
+
file.write("\n")
|
43
|
+
else if
|
44
|
+
page.response_time > 5000
|
39
45
|
puts "=======Slow Page======\n"
|
40
46
|
puts page.url
|
41
|
-
file = File.open('slow_pages.html', 'a')
|
47
|
+
file = File.open('slow_pages.html', 'a+')
|
42
48
|
file.puts page.url
|
43
|
-
|
49
|
+
file.write("\n")
|
50
|
+
file.write("Returned with response time \n")
|
51
|
+
file.write("\n")
|
52
|
+
file.puts page.response_time
|
53
|
+
else if
|
54
|
+
page.response_time > 10000
|
55
|
+
puts "=======Very Slow Page======\n"
|
56
|
+
puts page.url
|
57
|
+
file = File.open('extremely_slow_pages.html', 'a+')
|
58
|
+
file.puts page.url
|
59
|
+
file.write("\n")
|
60
|
+
file.write("Returned with response time which is not acceptable at all \n")
|
61
|
+
file.write("\n")
|
62
|
+
file.puts page.response_time
|
63
|
+
end
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
44
67
|
end
|
45
68
|
end
|
data/lib/driller/version.rb
CHANGED