lib/wmap/utils/url_magic.rb
# Simple sanity check on a 'claimed' URL string.
Simple sanity check on a 'claimed' URL string.
Simple sanity check on a ' claimed ' URL string .
def is_url?(url)
		puts "Validate the URL format is valid: #{url}" if @verbose
		if url =~ /(http|https)\:\/\/((.)+)/i
			host=$2.split('/')[0]
			host=host.split(':')[0]
			if is_ip?(host) or is_fqdn?(host)
				return true
			else
				return false
			end
		else
			puts "Unknown URL format: #{url}" if @verbose
			return false
		end
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
		return false
	end
def is_url? ( url ) puts "Validate the URL format is valid: #{url}" if @verbose if url =~ / (http|https) \: \/ \/ ((.)+) /i host = $2 . split ( '/' ) [ 0 ] host = host . split ( ':' ) [ 0 ] if is_ip? ( host ) or is_fqdn? ( host ) return true else return false end else puts "Unknown URL format: #{url}" if @verbose return false end rescue => ee puts "Exception on method #{__method__}: #{ee}" if @verbose return false end
Simple sanity check on a 'claimed' URL string.
Simple sanity check on a ' claimed ' URL string .
url
<not_specific>