lib/sniffles/sniffers/advertising/adsense.rb in sniffles-0.1.5 vs lib/sniffles/sniffers/advertising/adsense.rb in sniffles-0.2.0

- old
+ new

@@ -1,30 +1,24 @@ module Sniffles module Sniffers class Adsense include Text - + attr_accessor :doc attr_reader :output - + def initialize(response_body) - @output = {} + @output = {} parse(response_body) && process_document end - + def process_document - if @output[:found] = found? - parse_publisher_id - end + @output[:found] = found? end - + private def found? - match? /googleAddAdSenseService/ + match?(/googletag\.pubads\(\)/) end - - def parse_publisher_id - @output[:publisher_id] = capture(/googleAddAdSenseService\(["|']+([a-z]+\-pub\-[\d]+)["|']+\)/) - end end end -end \ No newline at end of file +end