Created
November 20, 2013 23:30
-
-
Save DanBradbury/7573153 to your computer and use it in GitHub Desktop.
scraping requests+params from production
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
f = File.open("dip_log", "r") | |
request_count = 0 | |
requests = [] | |
params = [] | |
mark1 = "{" | |
mark2 = "}" | |
while line = f.gets | |
if line.start_with?( "Processing") | |
split = line.split(" ") | |
requests << split[1] | |
request_count += 1 | |
elsif line.start_with?(" Parameters:") | |
split = line[/#{makr1}(.*?)#{mark2}/m, 1] | |
params << split.split(",") | |
end | |
end | |
puts "#{request_count} Requests Made" | |
for i in 0..request_count | |
puts requests[i] | |
puts params[i] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment