Check HTTP status of each value in /robots.txt
This commit is contained in:
@@ -15,6 +15,12 @@ class WebSite
|
|||||||
@uri.clone.merge('robots.txt').to_s
|
@uri.clone.merge('robots.txt').to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Check status code for each robots.txt entry
|
||||||
|
def header_robots_txt(url)
|
||||||
|
code = Browser.get(url).code
|
||||||
|
puts info("Interesting entry from robots.txt: #{url} [HTTP #{code}]")
|
||||||
|
end
|
||||||
|
|
||||||
# Parse robots.txt
|
# Parse robots.txt
|
||||||
# @return [ Array ] URLs generated from robots.txt
|
# @return [ Array ] URLs generated from robots.txt
|
||||||
def parse_robots_txt
|
def parse_robots_txt
|
||||||
|
|||||||
@@ -240,7 +240,7 @@ def main
|
|||||||
puts info("robots.txt available under: #{wp_target.robots_url}")
|
puts info("robots.txt available under: #{wp_target.robots_url}")
|
||||||
|
|
||||||
wp_target.parse_robots_txt.each do |dir|
|
wp_target.parse_robots_txt.each do |dir|
|
||||||
puts info("Interesting entry from robots.txt: #{dir}")
|
wp_target.header_robots_txt(dir)
|
||||||
end
|
end
|
||||||
spacer()
|
spacer()
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user