Skip to content

Instantly share code, notes, and snippets.

@timurvafin
Created September 14, 2010 12:26
Show Gist options
  • Save timurvafin/578956 to your computer and use it in GitHub Desktop.
Save timurvafin/578956 to your computer and use it in GitHub Desktop.
#!/bin/env ruby
# Usage: ruby wifi.rb wifi.kml.xml > free_wifi.kml.xml
require 'rubygems'
require 'pp'
require 'nokogiri'
xml_doc = Nokogiri::XML(File.open(ARGV.first))
xml_doc.css('Placemark').each do |placemark|
description = placemark.css('description').first.inner_html
placemark.remove unless description =~ /Security: None/
end
puts xml_doc.to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment