Sha256: c961bd0d0c5e7bb815734d1024250424a57f55df740c06c8b4c8b9b9b2634ef6

Contents?: true

Size: 794 Bytes

Versions: 31

Compression:

Stored size: 794 Bytes

Contents

# filter to select findings for the list of sites
# Usage: ruby filter_site.rb [file targets] [file finding keys]
# Input A is a list of target sites, input B is a list of site index keys for the finding summary
# Output is a list of key for the matching purpose

require "wmap"
@map=Hash.new

def build_map (file)
	k=Wmap::SiteTracker.instance
	f=File.open(file,'r')
	f.each do |line|
		url=line.chomp.strip.downcase
		if k.is_url?(url)
			@map[k.url_2_site(url)]=true
		else
			#puts url
		end
	end
	f.close
	k=nil
end


build_map(ARGV[0])
s=Wmap::SiteTracker.instance
f=File.open(ARGV[1],'r')
f.each do |line|
	url=line.chomp.strip.downcase
	if s.is_url?(url)
		site=s.url_2_site(url)
		if @map.key?(site)
			puts "yes"
		else
			puts "no"
		end
	else
		puts "Invalid Internet URL"
	end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
wmap-2.8.4 demos/filter_site.rb
wmap-2.8.3 demos/filter_site.rb
wmap-2.8.2 demos/filter_site.rb
wmap-2.8.1 demos/filter_site.rb
wmap-2.7.9 demos/filter_site.rb
wmap-2.7.7 demos/filter_site.rb
wmap-2.7.6 demos/filter_site.rb
wmap-2.7.2 demos/filter_site.rb
wmap-2.7.1 demos/filter_site.rb
wmap-2.7.0 demos/filter_site.rb
wmap-2.6.9 demos/filter_site.rb
wmap-2.6.8 demos/filter_site.rb
wmap-2.6.7 demos/filter_site.rb
wmap-2.6.6 demos/filter_site.rb
wmap-2.6.5 demos/filter_site.rb
wmap-2.6.4 demos/filter_site.rb
wmap-2.6.3 demos/filter_site.rb
wmap-2.6.2 demos/filter_site.rb
wmap-2.6.1 demos/filter_site.rb
wmap-2.6.0 demos/filter_site.rb