lib/page_rankr/backlink.rb in PageRankr-2.0.4 vs lib/page_rankr/backlink.rb in PageRankr-3.0.0

- old
+ new

@@ -1,24 +1,9 @@ -require 'rubygems' -require 'nokogiri' -require 'open-uri' +require File.expand_path('../tracker', __FILE__) module PageRankr module Backlink - attr_reader :backlinks - alias_method :tracked, :backlinks - - def initialize(site) - @site = site - - request.on_complete do |response| - html = Nokogiri::HTML(response.body) - @backlinks = clean(html.at(xpath).to_s) - @backlinks = nil if @backlinks.zero? - end - end - - def clean(backlink_count) - backlink_count.gsub(/[a-zA-Z,\s\(\)]/, '').to_i - end + include Tracker + + alias_method :backlink, :tracked end end \ No newline at end of file