Class: PageRankr::Ranks::Google

Inherits:
Object
  • Object
show all
Includes:
PageRankr::Rank
Defined in:
lib/page_rankr/ranks/google.rb,
lib/page_rankr/ranks/google/checksum.rb

Defined Under Namespace

Classes: Checksum

Instance Attribute Summary

Attributes included from Tracker

#body, #raw, #tracked

Instance Method Summary collapse

Methods included from Tracker

#clean, #content, #method, #proxy, #run, #tracked_url

Constructor Details

#initialize(site, options = {}) ⇒ Google

Returns a new instance of Google.



9
10
11
12
13
14
# File 'lib/page_rankr/ranks/google.rb', line 9

def initialize(site, options = {})
  @site = PageRankr::Site(site)
  @checksum = Checksum.generate("info:#{tracked_url}")
  
  super(site, options)
end

Instance Method Details

#nameObject



32
33
34
# File 'lib/page_rankr/ranks/google.rb', line 32

def name
  :ranks_google
end

#paramsObject



24
25
26
# File 'lib/page_rankr/ranks/google.rb', line 24

def params
  {:client => "navclient-auto", :ch => @checksum, :features => "Rank", :q => "info:#{tracked_url}"}
end

#regexObject



28
29
30
# File 'lib/page_rankr/ranks/google.rb', line 28

def regex
  /Rank_\d+:\d+:(\d+)/
end

#supported_componentsObject



16
17
18
# File 'lib/page_rankr/ranks/google.rb', line 16

def supported_components
  [:subdomain, :path, :query]
end

#urlObject



20
21
22
# File 'lib/page_rankr/ranks/google.rb', line 20

def url
  "http://toolbarqueries.google.com/tbr"
end