Moved http response to a function

This commit is contained in:
g0tmi1k
2018-05-14 16:35:41 +01:00
parent 38f70a88ae
commit 715d3d4ad6
3 changed files with 24 additions and 10 deletions

View File

@@ -326,4 +326,9 @@ def valid_json?(json)
return true
rescue JSON::ParserError => e
return false
end
# Get the HTTP response code
def get_http_status(url)
Browser.get(url.to_s).code
end

View File

@@ -15,12 +15,6 @@ class WebSite
@uri.clone.merge('robots.txt').to_s
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
# @return [ Array ] URLs generated from robots.txt
def parse_robots_txt