Skip to content

Instantly share code, notes, and snippets.

View McKay1717's full-sized avatar
💭
I may be slow to respond.

McKay1717

💭
I may be slow to respond.
View GitHub Profile
@McKay1717
McKay1717 / alexatopsites.rb
Last active October 10, 2015 14:36 — forked from eladkehat/alexatopsites.rb
Get the list of top sites for a given country from Alexa
# Get the list of top sites for a given country from Alexa, found here:
# http://www.alexa.com/topsites/countries/<country code>
# and transform it into a nice text file, one domain per line.
# Supply the country code as the first argument. Defaults to US.
require 'rubygems'
require 'open-uri'
require 'nokogiri'
BASE_URL = "http://www.alexa.com/topsites/countries"
country = ARGV[0] || "FR"