[sourcecode language="ruby"]
USER=""
PASS=""
def UrlAvailable?(urlStr)
url = URI.parse(urlStr)
http2 = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url.request_uri)
request.basic_auth("#{USER}" ,"#{PASS}")
response=http2.request(request)
if response.to_s().index('HTTPOK') == nil
return false
else
return true
end
end
[/sourcecode]