lib/wmap/utils/url_magic.rb
# Extract the web server host's Fully Qualified Domain Name (FQDN) from the url. For example: "https://login.yahoo.com/email/help" -> "login.yahoo.com"
Extract the web server host's Fully Qualified Domain Name (FQDN) from the url.
Extract the web server host ' s Fully Qualified Domain Name ( FQDN ) from the url .
def url_2_host (url)
		url = url.strip.downcase.gsub(/(http:\/\/|https:\/\/)/, "")
		record1 = url.split('/')
		if record1[0].nil?
			puts "Error process url: #{url}"
			return nil
		else
			record2 = record1[0].split(':')
			return record2[0]
		end
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
		return nil
	end
def url_2_host ( url ) url = url . strip . downcase . gsub ( / (http: \/ \/ |https: \/ \/ ) / , "" ) record1 = url . split ( '/' ) if record1 [ 0 ] . nil? puts "Error process url: #{url}" return nil else record2 = record1 [ 0 ] . split ( ':' ) return record2 [ 0 ] end rescue => ee puts "Exception on method #{__method__}: #{ee}" if @verbose return nil end
Extract the web server host's Fully Qualified Domain Name (FQDN) from the url.
Extract the web server host ' s Fully Qualified Domain Name ( FQDN ) from the url .
url
<not_specific>