Report abuse


			
require 'time'
lines = `git log --pretty=format:%ai`
times = lines.map { |l| Time.parse l }

dots = []
0.upto(7) { |wday|
  0.upto(23) { |hour|
    dots << [hour, wday, times.find_all { |t| t.hour == hour && t.wday == wday }.size]
  }
}

max = dots.map { |h,w,c| c }.max

puts "http://chart.apis.google.com/chart?chs=800x300&chds=-1,24,-1,7,0,#{max}&chf=bg,s,efefef&chd=t:#{dots.transpose.map { |c| c.join(",") }.join("|")}&chxt=x,y&chm=o,333333,1,1.0,25.0&chxl=0:||12am|1|2|3|4|5|6|7|8|9|10|11|12pm|1|2|3|4|5|6|7|8|9|10|11||1:||Sun|Mon|Tue|Wed|Thr|Fri|Sat|&cht=s"