Skip to content

Instantly share code, notes, and snippets.

@federomero
Created February 7, 2013 12:49
Show Gist options
  • Save federomero/4730701 to your computer and use it in GitHub Desktop.
Save federomero/4730701 to your computer and use it in GitHub Desktop.
Get alexa ranks for a list of urls
require 'alexa'
key = "…"
secret = "…"
client = Alexa::Client.new(access_key_id: key, secret_access_key: secret)
STDIN.each_line do |l|
url = l.rstrip
rank = client.url_info({
url: url,
response_group: 'Rank',
}).rank
puts rank
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment