« Things I learned | Main

netselect-if

If you're like me, you've wondered which Interactive Fiction Archive mirror is fastest for you. Wonder no more!


#!/usr/bin/env ruby

require 'open-uri'
require 'hpricot'

doc = Hpricot(open("http://www.ifarchive.org/"))
mirrors =(doc.search("div.ArchiveMirrors")/"a").map {|a| a['href'].strip.match(/^[^\/]+\/\/([^\/]+)/)[1]}.reject {|m| m == "mirror.ifarchive.org"}.uniq
system(*(%w(netselect -v -s 5) + mirrors))

Post a comment

(If you haven't left a comment here before, you may need to be approved by the site owner before your comment will appear. Until then, it won't appear on the entry. Thanks for waiting.)