Sha256: d75a57dbfafb7b2abcf2c9245f8321a0eab22bdce6e3836186cc324fcd9f75fd

Contents?: true

Size: 344 Bytes

Versions: 2

Compression:

Stored size: 344 Bytes

Contents

require 'nokogiri'
require 'open-uri'

module PageRankr
  class Index
    attr_reader :indexes
    alias_method :tracked, :indexes
    
    def initialize(site)
      @indexes = clean Nokogiri::HTML(open url(site)).at(xpath).to_s
    end
    
    def clean(backlink_count)
      backlink_count.gsub(/[a-zA-Z,\s\(\)]/, '').to_i
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
PageRankr-1.7.1 lib/page_rankr/index.rb
PageRankr-1.7.0 lib/page_rankr/index.rb