Sha256: 967b55588fc13c6a16b50499a5eeec599840d5ffbd4ea5ebc503b76505abdaef

Contents?: true

Size: 919 Bytes

Versions: 2

Compression:

Stored size: 919 Bytes

Contents

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
        [:subdomain]
      end

      def name
        :ranks_alexa_country
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
PageRankr-4.6.1 lib/page_rankr/ranks/alexa_country.rb
PageRankr-4.6.0 lib/page_rankr/ranks/alexa_country.rb