Sha256: 6db1d3d7d21abf423efd74055d03aa9a4ccc272d5a6e2fbb7ed0558addb8d7c7
Contents?: true
Size: 757 Bytes
Versions: 4
Compression:
Stored size: 757 Bytes
Contents
require 'typhoeus' require File.join(File.dirname(__FILE__), "google", "checksum") module PageRankr class Ranks class Google include Rank def initialize(site) @site = site @checksum = Checksum.generate(@site.to_s) request.on_complete do |response| @rank = if response.body =~ regex clean($1) else nil end end end def regex /Rank_\d+:\d+:(\d+)/ end def request @request ||= Typhoeus::Request.new("http://toolbarqueries.google.com/search", :params => {:client => "navclient-auto", :ch => @checksum, :features => "Rank", :q => "info:#{@site.to_s}"}) end end end end
Version data entries
4 entries across 4 versions & 1 rubygems