lib/wmap/domain_tracker/sub_domain.rb
# Procedures to identify sub-domain from the hosts store
Procedures to identify sub-domain from the hosts store
Procedures to identify sub - domain from the hosts store
def update_from_host_store!
		puts "Invoke internal procedures to update the sub-domain list from the host store."
		my_tracker = Wmap::HostTracker.instance
		my_tracker.data_dir = @data_dir
		my_tracker.hosts_file = my_tracker.data_dir + "/" + "hosts"
		my_tracker.load_known_hosts_from_file(my_tracker.hosts_file)
		subs = my_tracker.dump_sub_domains - [nil,""]
		my_tracker = nil
		unless subs.empty?
			self.bulk_add(subs,@max_parallel)
		end
		puts "Update discovered sub-domains into the store: #{@known_internet_sub_domains}"
		self.save!(file_domains=@file_sub_domains, domains=@known_internet_sub_domains)
	rescue Exception => ee
		puts "Exception on method #{__method__}: #{ee}" if @verbose
		return nil
	end
def update_from_host_store! puts "Invoke internal procedures to update the sub-domain list from the host store." my_tracker = Wmap :: HostTracker . instance my_tracker . data_dir = @data_dir my_tracker . hosts_file = my_tracker . data_dir + "/" + "hosts" my_tracker . load_known_hosts_from_file ( my_tracker . hosts_file ) subs = my_tracker . dump_sub_domains - [ nil , "" ] my_tracker = nil unless subs . empty? self . bulk_add ( subs , @max_parallel ) end puts "Update discovered sub-domains into the store: #{@known_internet_sub_domains}" self . save! ( file_domains = @file_sub_domains , domains = @known_internet_sub_domains ) rescue Exception => ee puts "Exception on method #{__method__}: #{ee}" if @verbose return nil end
Procedures to identify sub-domain from the hosts store
Procedures to identify sub - domain from the hosts store
# Step 1 - obtain the latest sub-domains # Step 2 - update the sub-domain list #subs.map { |x| self.add(x) unless domain_known?(x) }