Sha256: ad7840df50a429977ff0d59a30a424b180c673d343535830d47db7931c348f9a

Contents?: true

Size: 612 Bytes

Versions: 4

Compression:

Stored size: 612 Bytes

Contents

module Sniffles
  module Sniffers
    class Phpbb
      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?
        @doc.text.include?("Powered by phpBB") && phpbb_meta?
      end    
      
      def phpbb_meta?
        !@doc.xpath("//meta[@name='resource-type']").empty? && !@doc.xpath("//meta[@name='distribution']").empty?
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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