Module: DisavowTool

Defined in:
lib/disavow_tool.rb,
lib/disavow_tool/list.rb,
lib/disavow_tool/config.rb,
lib/disavow_tool/version.rb,
lib/disavow_tool/white_list.rb,
lib/disavow_tool/disavow_list.rb,
lib/disavow_tool/domain_and_url.rb,
lib/disavow_tool/imported_links.rb,
lib/disavow_tool/command_options.rb

Defined Under Namespace

Modules: DomainAndUrl Classes: Commands, DisavowList, ImportedLinks, List, WhiteList

Constant Summary collapse

EXPORT_PATH =
"exports/"
IMPORT_PATH =
"test/"
SECONDS_TITTLE_REQUEST =
5
VERSION =
"0.3.3"
OPTIONS =
Commands.parse_inputs

Class Method Summary collapse

Class Method Details

.runObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'lib/disavow_tool.rb', line 15

def self.run
  puts "Importing new links".blue if OPTIONS.verbose
  imported_links = ImportedLinks.new

  puts "Importing Disavowed links".blue if OPTIONS.verbose
  disavowed = DisavowList.new

  if OPTIONS.whitelist
    puts "Importing Whitelist links".blue if OPTIONS.verbose
    white_list = WhiteList.new
    puts "Cleagning imported links already in whitelist".blue if OPTIONS.verbose
    imported_links.remove_known_links(white_list.links)
    puts "Cleagning imported links with a domain existingin in whitelist".blue if OPTIONS.verbose
    p white_list.domains
    imported_links.remove_known_links_for_domain(white_list.domains)
  end


  puts "Cleagning imported links already in Disavow".blue if OPTIONS.verbose
  imported_links.remove_known_links(disavowed.links)

  puts "Cleagning imported links with a domain existingin in Disavow".blue if OPTIONS.verbose
  imported_links.remove_known_links_for_domain(disavowed.domains)

  imported_links.summary

  imported_links.analyse(disavowed, white_list)

  disavowed.summary if OPTIONS.verbose
  white_list.summary if OPTIONS.verbose

  puts "Exporting...".red if OPTIONS.verbose
  disavowed.export
  white_list.export if OPTIONS.whitelist
end