# HG changeset patch # User God of Dice@mf-nb # Date 1310861001 -7200 # Node ID 7e50244d8e42aac8927d19995fa6371b500a8117 # Parent cecdfba8e625373145df59df16765d5f854e888e plugins.xkcd: Microsoft apparently hates %T (crashes on Windows) reformat Code diff -r cecdfba8e625 -r 7e50244d8e42 plugins/xkcd.lua --- a/plugins/xkcd.lua Sun Jul 24 19:16:40 2011 +0700 +++ b/plugins/xkcd.lua Sun Jul 17 02:03:21 2011 +0200 @@ -7,9 +7,9 @@ local http = require("net.http"); bot:hook("commands/xkcd", function(command) if os.difftime(os.time(), xkcd_list_updated_at) > (3 * 60 * 60) then -- Not refreshed within 3 hours - http.request('http://xkcd.com/archive/', { - headers = { ["If-Modified-Since"] = os.date("!%a, %d %b %Y %T %Z", xkcd_list_updated_at or 0) } - }, function (data, code) + --COMPAT We could have saved 6 bytes here, but Microsoft apparently hates %T, so you got this gigantic comment instead. + -- http.request('http://xkcd.com/archive/', { headers = { ["If-Modified-Since"] = os.date("!%a, %d %b %Y %T %Z", xkcd_list_updated_at or 0) } }, function (data, code) + http.request('http://xkcd.com/archive/', { headers = { ["If-Modified-Since"] = os.date("!%a, %d %b %Y %H:%M:%S %Z", xkcd_list_updated_at or 0) } }, function (data, code) if code == 200 then xkcd_list_updated_at = os.time(); print("debug", "got "..(#data or 0).." bytes of data");