Skip to content

Instantly share code, notes, and snippets.

@DanBradbury
Created November 20, 2013 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DanBradbury/7573153 to your computer and use it in GitHub Desktop.
Save DanBradbury/7573153 to your computer and use it in GitHub Desktop.
scraping requests+params from production
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