-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
9643e3e
commit 8c9883b
Showing
4 changed files
with
41 additions
and
1 deletion.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
require File.expand_path('../../rank', __FILE__) | ||
|
||
module PageRankr | ||
class Ranks | ||
class AlexaCountry | ||
include Rank | ||
|
||
def url | ||
"http://data.alexa.com/data" | ||
end | ||
|
||
def params | ||
{:cli => 10, :dat => "snbamz", :url => tracked_url} | ||
end | ||
|
||
# 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. | ||
def xpath | ||
"//country/@rank" | ||
end | ||
|
||
def supported_components | ||
[:domain] | ||
end | ||
|
||
def name | ||
:ranks_alexa_country | ||
end | ||
end | ||
end | ||
end |
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
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