lib/wmap/utils/url_magic.rb
# Test the URL / Site and return the landing url location (recursive with the depth = 4 )
Test the URL / Site and return the landing url location (recursive with the depth = 4 )
Test the URL / Site and return the landing url location ( recursive with the depth = 4 )
def landing_location (depth=5, url)
		depth -= 1
		return url if depth < 1
		timeo = Max_http_timeout/1000.0
		uri = URI.parse(url)
		code = response_code (url)
		if code >= 300 && code < 400
			url = redirect_location (url)
			url = landing_location(depth,url)
		else
			return url
		end
		return url
	rescue Exception => ee
		puts "Exception on method #{__method__} on URL #{url}: #{ee}" if @verbose
	end
def landing_location ( depth = 5 , url ) depth -= 1 return url if depth < 1 timeo = Max_http_timeout / 1000.0 uri = URI . parse ( url ) code = response_code ( url ) if code >= 300 && code < 400 url = redirect_location ( url ) url = landing_location ( depth , url ) else return url end return url rescue Exception => ee puts "Exception on method #{__method__} on URL #{url}: #{ee}" if @verbose end
Test the URL / Site and return the landing url location (recursive with the depth = 4 )
Test the URL / Site and return the landing url location ( recursive with the depth = 4 )
depth
<not_specific>
url
<not_specific>