Created
January 29, 2010 14:42
-
-
Save nono/289765 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env ruby | |
| # Author: Bruno Michel <[email protected]> | |
| # Copyright 2010 (c) af83 | |
| # Licence: MIT http://www.opensource.org/licenses/mit-license.php | |
| # Parse the given log files and extract the list of URL | |
| if ARGV.empty? | |
| puts "Usage: #{$0} <logfiles>" | |
| exit 1 | |
| end | |
| require 'set' | |
| urls = Set.new | |
| ARGV.each do |filename| | |
| File.open(filename).each_line do |line| | |
| if line =~ /^Completed .* 200 OK \[(.*)\]$/ | |
| urls << $1.split('?').first | |
| end | |
| end | |
| end | |
| urls.sort.each { |url| puts url } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment