# HG changeset patch # User Mikael Berthe # Date 1348915848 -7200 # Node ID 5d807892b4391513090428065d09df4646952cde # Parent 74697f376dad2a2878fc99f00e53d38490a1b4e3 tvcal: Work around buggy 0x0d at end of lines I always wonder how people can generate such ugly HTML code pages... diff -r 74697f376dad -r 5d807892b439 mcbot/cmds/tvcal.lua --- a/mcbot/cmds/tvcal.lua Sat Sep 29 11:40:10 2012 +0200 +++ b/mcbot/cmds/tvcal.lua Sat Sep 29 12:50:48 2012 +0200 @@ -32,14 +32,17 @@ return nil, "Could not fetch calendar, please try again later!" end + -- Work around frackin ugly end of line characters... :/ + local eol = "[%s"..string.char(13).."]*" + -- Regex for each day local tabregex = ''.. '%s*(.-)%s*' -- Regex for parsing one day local epregex = ']*>'.. - ']+>([^<]+)'.. -- Name - '
]+>([^<]+)'.. -- Episode + ']+>([^<]+)'..eol.. -- Name + '
]+>([^<]+)'..eol.. -- Episode '

' -- loop over all days