/
githubmirror
/
metasploit-framework
Обзор
Документация
Войти
/
githubmirror
/
metasploit-framework
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
lib/anemone/cli/pagedepth.rb
32 строки
699 B
HD Moore
Initial import of an Anemone snapshot
06 ноя 2010, 07:34
06 ноя 2010, 07:34
b3cc6e1
Код
Авторство
О чём код?
require 'anemone' begin # make sure that the first option is a URL we can crawl root = URI(ARGV[0]) rescue puts <<-INFO Usage: anemone pagedepth <url> Synopsis: Crawls a site starting at the given URL and outputs a count of the number of pages at each depth of the crawl. INFO exit(0) end Anemone.crawl(root) do |anemone| anemone.skip_links_like %r{^/c/$}, %r{^/stores/$} anemone.after_crawl do |pages| pages = pages.shortest_paths!(root).uniq! depths = pages.values.inject({}) do |depths, page| depths[page.depth] ||= 0 depths[page.depth] += 1 depths end depths.sort.each { |depth, count| puts "Depth: #{depth} Count: #{count}" } end end