lib/wmap/utils/wp_detect.rb
# Wordpress detection checkpoint - WP generator tag
Wordpress detection checkpoint - WP generator tag
Wordpress detection checkpoint - WP generator tag
def wp_gen?(url)
  		puts "#{__method__} check for #{url}" if @verbose
  		site = url_2_site(url)
  		gen_url_1 = site + "feed/"
  		gen_url_2 = site + "comments/feed"
      k=Wmap::UrlChecker.new
      if k.response_code(gen_url_1) == 200
        doc=open_page(gen_url_1)
  		elsif k.response_code(gen_url_2) == 200
  			doc=open_page(gen_url_2)
  		else
  			k=nil
  			return false
  		end
      gens=doc.css('generator')
  		if gens.nil?
  			k=nil
  			return false
  		end
  		gens.each do |gen|
  			if gen.text.to_s =~ /wordpress/i
  				k=doc=nil
          return true
        end
  		end
  		k=doc=nil
  		return false
  	rescue => ee
  		puts "Exception on method #{__method__} for url #{url}: #{ee}" if @verbose
  		return false
    end
def wp_gen? ( url ) puts "#{__method__} check for #{url}" if @verbose site = url_2_site ( url ) gen_url_1 = site + "feed/" gen_url_2 = site + "comments/feed" k = Wmap :: UrlChecker . new if k . response_code ( gen_url_1 ) == 200 doc = open_page ( gen_url_1 ) elsif k . response_code ( gen_url_2 ) == 200 doc = open_page ( gen_url_2 ) else k = nil return false end gens = doc . css ( 'generator' ) if gens . nil? k = nil return false end gens . each do | gen | if gen . text . to_s =~ / wordpress /i k = doc = nil return true end end k = doc = nil return false rescue => ee puts "Exception on method #{__method__} for url #{url}: #{ee}" if @verbose return false end
Wordpress detection checkpoint - WP generator tag
Wordpress detection checkpoint - WP generator tag
#puts doc.inspect
url
<not_specific>