lib/wmap/site_tracker.rb
# determine site is trusted based on the known domains
determine site is trusted based on the known domains
determine site is trusted based on the known domains
def is_trusted?(site)
		trusted=false
		host=url_2_host(site)
		root=get_domain_root(host)
		domain_tracker=Wmap::DomainTracker.instance
		domain_tracker.data_dir=@data_dir
		domain_tracker.domains_file=@data_dir + "/" + "domains"
		File.write(domain_tracker.domains_file, "") unless File.exist?(domain_tracker.domains_file)
		domain_tracker.load_domains_from_file(domain_tracker.domains_file)
		trusted=domain_tracker.domain_known?(root)
		domain_tracker=nil
		return trusted
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}"
		return trusted
	end
def is_trusted? ( site ) trusted = false host = url_2_host ( site ) root = get_domain_root ( host ) domain_tracker = Wmap :: DomainTracker . instance domain_tracker . data_dir = @data_dir domain_tracker . domains_file = @data_dir + "/" + "domains" File . write ( domain_tracker . domains_file , "" ) unless File . exist? ( domain_tracker . domains_file ) domain_tracker . load_domains_from_file ( domain_tracker . domains_file ) trusted = domain_tracker . domain_known? ( root ) domain_tracker = nil return trusted rescue => ee puts "Exception on method #{__method__}: #{ee}" return trusted end
determine site is trusted based on the known domains
determine site is trusted based on the known domains
site
<not_specific>