Skip to content

Commit d4b3899

Browse files
committed
'traffic-data' displayer
1 parent 2993e61 commit d4b3899

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

traffic-data

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
#!/usr/bin/env ruby
2+
require 'epitools'
3+
4+
data = Path["~/dl/traffdata.bak"].lines.drop(1).map do |l|
5+
n, data = l.strip.split("=")
6+
[n.split("-")[1..-1].reverse, data.split]
7+
end.sort
8+
9+
data.each do |(year, month), days|
10+
total = days.pop
11+
12+
puts "=== #{year}-#{month} =============================="
13+
puts days.join ' '
14+
puts total
15+
puts
16+
end

0 commit comments

Comments
 (0)