Malicious enjoyment derived from observing someone else’s misfortune
 

Tag Archives: google earth

2007 Iditarod Tracking with Google Earth

I’ve created a Google Earth KML Feed of the current Iditarod standings. I’m generating it with Ruby. It’s pretty cool. If you want to try it, do one of the following: Download the Network Feed KML, which contains a link to the following KML and automatically updates every 10 minutes *or* Download the Current KML, which does not update, but is that actual static file the above KML uses. I recommend the feed. Here’s some pictures of the current state:

ZIP files in Rails

Today, I needed to make a KMZ file from my KML in Rails. This was easy thanks to RubyZIP: gem install rubyzip Now for the Rails action: # In your controller private def zip(data, filename) zipfile = “/tmp/rubyzip-#{rand 32768}” Zip::ZipOutputStream::open(zipfile) do |io| io.put_next_entry(filename) io.write data end zippy = File.open(zipfile).read File.delete(zipfile) zippy end This makes a temp file, adds to it zip-style, reads it to a string, and deletes it. It leaves nothing behind on the file system. Then all you [...]