Sha256: 95fc483c3409f038e09b14dc6afa1c464ec05d86dca7457f4e13fd0ce7bd8ad3

Contents?: true

Size: 361 Bytes

Versions: 1

Compression:

Stored size: 361 Bytes

Contents

require 'nokogiri'
require 'open-uri'

module PageRankr
  class Backlinks
    class Backlink
      attr_reader :backlinks
      
      def initialize(site)
        @backlinks = 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
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
PageRankr-1.3.0 lib/page_rankr/backlinks/backlink.rb