lib/wmap/site_tracker/wp_tracker.rb
# Add wordpress entry to the cache one at a time
Add wordpress entry to the cache one at a time
Add wordpress entry to the cache one at a time
def add(url, use_cache=true)
	  puts "Add entry to the local cache table: #{url}" if @verbose
    site=url_2_site(url)
		if use_cache && @known_wp_sites.key?(site)
			puts "Site is already exist. Skipping: #{site}"
		else
			record=Hash.new
			redirection = landing_location(site)
			if not [nil, ''].include?(redirection)
				if is_wp?(redirection)
					version = wp_ver(redirection)
	        record['site'] = site
					record['version'] = version
					record['redirection'] = redirection
					@known_wp_sites[site]=record
					puts "Entry added: #{record}"
				end
			else
				if is_wp?(site)
					version = wp_ver(site)
					record['version'] = version
					record['redirection'] = redirection
					@known_wp_sites[site]=record
					puts "Entry added: #{record}"
				end
			end
		end
    return record
	rescue => ee
		puts "Exception on method #{__method__}: #{ee}: #{url}" if @verbose
	end
def add ( url , use_cache = true ) puts "Add entry to the local cache table: #{url}" if @verbose site = url_2_site ( url ) if use_cache && @known_wp_sites . key? ( site ) puts "Site is already exist. Skipping: #{site}" else record = Hash . new redirection = landing_location ( site ) if not [ nil , '' ] . include? ( redirection ) if is_wp? ( redirection ) version = wp_ver ( redirection ) record [ 'site' ] = site record [ 'version' ] = version record [ 'redirection' ] = redirection @known_wp_sites [ site ] = record puts "Entry added: #{record}" end else if is_wp? ( site ) version = wp_ver ( site ) record [ 'version' ] = version record [ 'redirection' ] = redirection @known_wp_sites [ site ] = record puts "Entry added: #{record}" end end end return record rescue => ee puts "Exception on method #{__method__}: #{ee}: #{url}" if @verbose end
Add wordpress entry to the cache one at a time
Add wordpress entry to the cache one at a time
url
<not_specific>
use_cache
<not_specific>