lib/wmap/google_search_scraper.rb
# Save the discovered sites into a local file
Save the discovered sites into a local file
Save the discovered sites into a local file
def save_discovered_sites_from_scraper (file)
		puts "Save the discovery result(sites) into a local file: #{file}" if @verbose
		begin
			f=File.open(file, 'w')
			timestamp=Time.now
			f.puts "# Discovery result written by Wmap::GoogleSearchScraper.save_discovered_sites_from_scraper method at #{timestamp}\n"
			@discovered_sites_from_scraper.keys.sort.map { |x| f.puts "#{x}\n" }
			f.close
			raise "Unknown problem saving the result to file: #{file}" unless File.exist?(file)
			puts "Done saving the discovery result into the local file: #{file}" 
        rescue => ee
			puts "Error on method save_discovered_sites_from_scraper: #{ee}" if @verbose
        end
	end
def save_discovered_sites_from_scraper ( file ) puts "Save the discovery result(sites) into a local file: #{file}" if @verbose begin f = File . open ( file , 'w' ) timestamp = Time . now f . puts "# Discovery result written by Wmap::GoogleSearchScraper.save_discovered_sites_from_scraper method at #{timestamp}\n" @discovered_sites_from_scraper . keys . sort . map { | x | f . puts "#{x}\n" } f . close raise "Unknown problem saving the result to file: #{file}" unless File . exist? ( file ) puts "Done saving the discovery result into the local file: #{file}" rescue => ee puts "Error on method save_discovered_sites_from_scraper: #{ee}" if @verbose end end
Save the discovered sites into a local file
Save the discovered sites into a local file
file
<not_specific>