#! /usr/bin/lua package.path = "cgi/?.lua" local koth = require "koth" local max_by_cat = {} local f = io.popen("ls packages") for cat in f:lines() do max_by_cat[cat] = 0 end f:close() for line in io.lines("state/points.log") do local ts, team, cat, points, comment = line:match("^(%d+) (%w+) (%w+) (%d+) ?(.*)") points = tonumber(points) or 0 -- Skip scores for removed categories if (max_by_cat[cat] ~= nil) then max_by_cat[cat] = math.max(max_by_cat[cat], points) end end local body = "