class Socialinvestigator::Client::Net::PageKnowledge
Constants
- TEMPLATE
Public Class Methods
new( debug = false )
click to toggle source
# File lib/socialinvestigator/client/net.rb, line 16 def initialize( debug = false ) @debug = debug @knowledge = {} end
Public Instance Methods
another( key, value )
click to toggle source
# File lib/socialinvestigator/client/net.rb, line 28 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/net.rb, line 97 def description @knowledge[:twitter_description] || @knowledge[:og_description] || @knowledge[:description] end
image()
click to toggle source
# File lib/socialinvestigator/client/net.rb, line 101 def image @knowledge[:twitter_image] || @knowledge[:og_image] end
p( key, val = nil )
click to toggle source
# File lib/socialinvestigator/client/net.rb, line 74 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/net.rb, line 37 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 p :technologies end
remember( key, value )
click to toggle source
# File lib/socialinvestigator/client/net.rb, line 21 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/net.rb, line 89 def title @knowledge[:twitter_title] || @knowledge[:og_title] || @knowledge[:page_title] end