class PageRankr::Ranks::AlexaGlobal

Public Instance Methods

name() click to toggle source
# File lib/page_rankr/ranks/alexa_global.rb, line 30
def name
  :ranks_alexa_global
end
params() click to toggle source
# File lib/page_rankr/ranks/alexa_global.rb, line 12
def params
  {:cli => 10, :dat => "snbamz", :url => tracked_url}
end
supported_components() click to toggle source
# File lib/page_rankr/ranks/alexa_global.rb, line 26
def supported_components
  [:subdomain]
end
url() click to toggle source
# File lib/page_rankr/ranks/alexa_global.rb, line 8
def url
  "http://data.alexa.com/data"
end
xpath() click to toggle source

Alexa may sometimes return a result for the incorrect site and thus it is necessary to check if the results returned are for the site we want.

For example, slocourts.net returns results for ca.gov, presumably because www.slocourts.ca.gov redirects to slocourts.net. Clearly something is wrong with how Alexa handles this case and so in the event this happens we treat the results as if there were no results.

# File lib/page_rankr/ranks/alexa_global.rb, line 22
def xpath
   "//popularity/@text"
end