mail: jos _dot_ decoster _at_ gmail _dot_ com
jdc on the Tcler's chat.
homepage: http://sites.google.com/site/josdecoster
For an application I develop, I'm using the BLT commands bgexec, busy, graph and barchart. bgexec and busy are available as starkits (check Standalone bgexec and busy), but the graph and barchart commands have no startkit equivalent. So I had to get BLT going for Tcl 8.5.2. The followings changes were needed:
Edit statistics can be generated with this script:
package require Mk4tcl mk::file open db wikit-20081226.tkd -readonly proc get_nick {who} { set idx [string first @ $who] if {$idx > 0} { return [string range $who 0 [expr {$idx-1}]] } else { return $who } } mk::loop i db.pages { lassign [mk::get $i name who date] name who date set y [clock format $date -format %Y] incr ys($y) incr w($y,[get_nick $who]) incr p($y,[string range $i 9 end]) mk::loop j $i.changes { lassign [mk::get $j who date] who date set y [clock format $date -format %Y] incr ys($y) incr w($y,[get_nick $who]) incr p($y,[string range $i 9 end]) } } foreach y [lsort -integer [array names ys]] { puts "***$y: $ys($y) edits***" set l {} foreach {k v} [array get p $y,*] { set n [lindex [split $k ,] end] set name [mk::get db.pages!$n name] lappend l [list $name $v] } set n 0 puts "\n%|Page|Number of edits|%" foreach il [lsort -integer -decreasing -index 1 $l] { puts "&|[join $il |]|&" incr n if {$n>20} {break} } set l {} foreach {k v} [array get w $y,*] { lappend l [list [lindex [split $k ,] end] $v] } set n 0 puts "\n%|Nick|Number of edits|%" foreach il [lsort -integer -decreasing -index 1 $l] { puts "&|[join $il |]|&" incr n if {$n>20} {break} } } mk::file close db