Created
October 7, 2014 16:27
-
-
Save skout23/93e5f70dfd3ee3cd7e79 to your computer and use it in GitHub Desktop.
stupid import thing
This file contains 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 | |
require 'time' | |
$output = File.open("tstamp.csv",'w') | |
$input = File.open("dork.in",'r') | |
def gimmetime(str) | |
d1 = Time.parse(str) | |
rm1 = Random.new | |
rand_secs1 = rm1.rand(100) * 60 | |
d2 = d1 + rand_secs1 | |
rm2 = Random.new | |
rand_secs2 = rm2.rand(45) * 60 | |
d3 = d2 + rand_secs2 | |
rm3 = Random.new | |
rand_sec3 = rm3.rand(120) * 60 | |
d4 = d3 + rand_sec3 | |
$output.puts "\"#{d1}\",\t\"#{d2}\",\t\"#{d3}\",\t\"#{d4}\"" | |
end | |
$input.read.each_line do |dork| | |
#dork = "23/May/13 12:11" | |
gimmetime(dork) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment