class PageKnowledge
Constants
- DEBUG
- TEMPLATE
Public Class Methods
new()
click to toggle source
# File lib/socialinvestigator/client/standalone_net.rb, line 16 def initialize; @knowledge = {} end
Public Instance Methods
another( key, value )
click to toggle source
# File lib/socialinvestigator/client/standalone_net.rb, line 25 def another( key, value ) return if value.nil? p key, value if DEBUG @knowledge[key] ||= [] @knowledge[key] << value @knowledge[key] = @knowledge[key].uniq end
description()
click to toggle source
# File lib/socialinvestigator/client/standalone_net.rb, line 94 def description @knowledge[:twitter_description] || @knowledge[:og_description] || @knowledge[:description] end
image()
click to toggle source
# File lib/socialinvestigator/client/standalone_net.rb, line 98 def image @knowledge[:twitter_image] || @knowledge[:og_image] end
p( key, val = nil )
click to toggle source
# File lib/socialinvestigator/client/standalone_net.rb, line 71 def p( key, val = nil ) val = @knowledge[key] if val.nil? if val.is_a?( Array ) printf TEMPLATE, key, val.join( ", ") if val.size > 0 elsif val.is_a?( Whois::Record::Contact ) printf TEMPLATE, key, "" [:name, :organization, :address, :city, :zip, :state, :country, :country_code, :phone, :fax, :email, :url, :created_on, :updated_on].each do |key| out = val.send( key ) printf "%25s: %s\n", key, out if out && out != "" end else printf TEMPLATE, key, val if val end end
print()
click to toggle source
# File lib/socialinvestigator/client/standalone_net.rb, line 34 def print p :domain p :created_on p :expires_on p :updated_on p :registrar_name p :registrar_url p :registrant_contact p :admin_contact p :technical_contact p :server_name p :server_country p :server_location p :server_latitude p :server_longitude p :server_ip_owner p :emails p :title, title p :description, description p :twitter_author, twitter_author p :twitter_ids p :image, image p :responsive p :rss_feed p :atom_feed p :twitter_links p :linkedin_links p :instagram_links p :facebook_links p :googleplus_links p :github_links # pp @knowledge end
remember( key, value )
click to toggle source
# File lib/socialinvestigator/client/standalone_net.rb, line 18 def remember( key, value ) return if value.nil? p key, value if DEBUG @knowledge[key] = value end
title()
click to toggle source
# File lib/socialinvestigator/client/standalone_net.rb, line 86 def title @knowledge[:twitter_title] || @knowledge[:og_title] || @knowledge[:page_title] end