driller 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +8 -8
  2. data/bin/driller +41 -18
  3. data/lib/driller/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTRlN2Y5NzM5ZTBlNWUwZTNkMTI2YTNhNmQ2MDc5MGVlNjNmNjVhNA==
4
+ MDhmMmFiMzVmNTk0N2NiMjQ0MTMxZWVmMWRkZGZkODQxZmYxZjk2Ng==
5
5
  data.tar.gz: !binary |-
6
- ZjQxYmNiZDFiOWQ4YWJkNTMyNmM1YzY1YjE2MDNiNDU4OWJjNTVmYQ==
6
+ NDBmMzE3NWM5NjU3NWUxNjczYTk0NWMzNWNlNDVkZDAxMDFhZGI4NQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MmQ0NzM4OTQxNDU0YjlkNTZlNTQ3MWVmMWQyYzAzNmU5ZmY2YzkwNTIzMDdi
10
- ZmJiZGZjZWUzYzhiMjUwZWVmYzEzMGVlZWY3MjkyMTg4MzAzYzA3Mjc4ZDVk
11
- ZmVjODU4Y2VhMTBmNzgzYTVkYTI1YzQ0ZTYzY2U0NzAyZmM5ZTE=
9
+ NWRkOTg2NDVkMTI3NWY2MGFmNDM2NGViY2MxYzRkODQ5YTc3NWM2YjE4YjU1
10
+ MmZlYTU3ZTc1NzBjNTg1N2Q0NGVlMjdjYjBiOTkzYjllYTNmNDBmYWQwNGI3
11
+ ZTAxZDNjYjA2YThkMDRhZWYzNWI0ODQ1OTkyYzI2OTY2ZGE2MzY=
12
12
  data.tar.gz: !binary |-
13
- OGU4MTI2NDY2YWNmYTViOTU3MDRkYmRjNGQ0ZTZkNDczZTllZDMzMGUzZWFj
14
- MjQ1YWMyOTM4NjE4NDRlNTdkYzczM2FjZjJmMDljMTlhNWVkMmNiZThmODA5
15
- NWE0Y2U0MjllYzY1ZTNjZTVmMTU2NDFmOGUwZWRhNGVlNTM5NjE=
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
- URL = ARGV[0]
8
+ webpage = ARGV[0]
9
9
  depth = ARGV[1]
10
10
 
11
- Anemone.crawl(URL) do |anemone|
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? URL }
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 = 200 && page.code = 301
26
- file = File.open('valid_pages.html', 'a')
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
- file = File.open('broken.html', 'a')
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
- end
36
-
37
-
38
- if page.response_time > 5000
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
- end
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
@@ -1,3 +1,3 @@
1
1
  module Driller
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: driller
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shashikant86