lib/page_rankr/index.rb in PageRankr-2.0.4 vs lib/page_rankr/index.rb in PageRankr-3.0.0
- old
+ new
@@ -1,22 +1,9 @@
-require 'nokogiri'
-require 'open-uri'
+require File.expand_path('../tracker', __FILE__)
module PageRankr
module Index
- attr_reader :indexes
- alias_method :tracked, :indexes
-
- def initialize(site)
- @site = site
- request.on_complete do |response|
- html = Nokogiri::HTML(response.body)
- @indexes = clean(html.at(xpath).to_s)
- @indexes = nil if @indexes.zero?
- end
- end
-
- def clean(backlink_count)
- backlink_count.gsub(/[a-zA-Z,\s\(\)]/, '').to_i
- end
+ include Tracker
+
+ alias_method :index, :tracked
end
end
\ No newline at end of file