module Gimme
Find the contact
Output info messages during gimme poc crawl.
Constants
- VERSION
Attributes
contact[RW]
contact_links[RW]
logger[RW]
page[RW]
status_code[R]
url[RW]
Public Class Methods
memory()
click to toggle source
Convenience method.
# File lib/gimme_poc.rb, line 61 def memory Search.all_sites end
poc(arr)
click to toggle source
The main method! Takes array of urls and gets contact info for each if possible. If url is bad, it's converted to nil in 'get' method and skipped over.
# File lib/gimme_poc.rb, line 49 def poc(arr) arr = arr.split unless arr.is_a?(Array) results = [] arr.each do |url| start_url_process(url) next if @status_code == 0 results << start_contact_process(url) end results.length == 1 ? results.first : results end
reset!()
click to toggle source
Clears entire collection.
# File lib/gimme_poc.rb, line 66 def reset! Search.all_sites = [] end
start_contact_process(url)
click to toggle source
# File lib/gimme_poc.rb, line 37 def start_contact_process(url) start_contact_links attempt = save_available_contacts(url) info = attempt.info if attempt && attempt.respond_to?(:info) return attempt unless info.nil? || info.empty? go_to_contact_page(url) end
start_url_process(url)
click to toggle source
# File lib/gimme_poc.rb, line 23 def start_url_process(url) LogMessages.start_url(url) case when LazyDomain.valid?(url) == false LogMessages.invalid_domain(url) @status_code = 0 when subdomain?(url) LogMessages.subdomain @status_code = 0 if get(url).nil? && get(orig_domain(url)).nil? else @status_code = 0 if get(url).nil? end end