Sha256: e9f11fa8632c1cc100ad26e58cffc871edfbfff840e275518b2fddaebfe7b8a0

Contents?: true

Size: 568 Bytes

Versions: 5

Compression:

Stored size: 568 Bytes

Contents

module Sniffles
  module Sniffers
    class Xenforo
      include HTML
      
      attr_accessor :doc
      attr_reader :output
      
      def initialize(response_body)
        @output = {}        
        parse(response_body) && process_document
      end
      
      def process_document
        @output[:found] = found?
      end
      
      private
      def found?
        meta_description_content == "Forum software by XenForo"
      end

      def meta_description_content
        text_at("//meta[@name='description']/@content")
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
sniffles-0.2.0 lib/sniffles/sniffers/cms/xenforo.rb
sniffles-0.1.5 lib/sniffles/sniffers/cms/xenforo.rb
sniffles-0.1.4 lib/sniffles/sniffers/cms/xenforo.rb
sniffles-0.1.3 lib/sniffles/sniffers/cms/xenforo.rb
sniffles-0.1.2 lib/sniffles/sniffers/cms/xenforo.rb