lib/page_rankr/backlinks/alexa.rb in PageRankr-1.7.1 vs lib/page_rankr/backlinks/alexa.rb in PageRankr-2.0.0

- old
+ new

@@ -1,11 +1,14 @@ -require 'cgi' +require 'typhoeus' module PageRankr - class Backlinks < Tracker - class Alexa < Backlink - def url(site) - "http://data.alexa.com/data?cli=10&dat=snbamz&url=#{CGI.escape(site)}" + class Backlinks + class Alexa + include Backlink + + def request + @request ||= Typhoeus::Request.new("http://data.alexa.com/data", + :params => {:cli => 10, :dat => "snbamz", :url => @site.to_s}, :method => :get) end def xpath "//linksin/@num" end \ No newline at end of file