Created
October 6, 2010 03:20
-
-
Save sbuys/612750 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'open3' | |
#Array of top 25 US sites by Alexa rank (daily visits & pageviews) | |
destinations = %w{ google.com facebook.com yahoo.com youtube.com amazon.com wikipedia.org twitter.com ebay.com craigslist.org blogspot.com live.com msn.com go.com bing.com aol.com linkedin.com espn.go.com myspace.com cnn.com wordpress.com netflix.com paypal.com imdb.com flickr.com microsoft.com } | |
destinations.each do |destination| | |
puts "\nTracing: #{destination}" | |
cmd_string = "traceroute -m 25 -w 1 #{destination}" #25 hops, 1s timeout | |
stdin, stdout, stderr = Open3.popen3(cmd_string) | |
stdout.each_with_index do |line, index| | |
puts line | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment