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