mcbot/cmds/tvcal.lua
author Mikael Berthe <mikael@lilotux.net>
Tue, 27 Nov 2012 16:26:04 +0100
changeset 66 d9c00a9fe9d5
parent 63 31f967ba9e1f
permissions -rw-r--r--
Add notices before public release
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     1
#! /usr/bin/env lua
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
     2
66
d9c00a9fe9d5 Add notices before public release
Mikael Berthe <mikael@lilotux.net>
parents: 63
diff changeset
     3
--  This module is part of the McBot / mcabbot project
d9c00a9fe9d5 Add notices before public release
Mikael Berthe <mikael@lilotux.net>
parents: 63
diff changeset
     4
--  Data extractor for http://www.pogdesign.co.uk/cat/
d9c00a9fe9d5 Add notices before public release
Mikael Berthe <mikael@lilotux.net>
parents: 63
diff changeset
     5
--
d9c00a9fe9d5 Add notices before public release
Mikael Berthe <mikael@lilotux.net>
parents: 63
diff changeset
     6
-- Copyright (C) 2010-2012 Mikael Berthe <mikael@lilotux.net>
d9c00a9fe9d5 Add notices before public release
Mikael Berthe <mikael@lilotux.net>
parents: 63
diff changeset
     7
--
d9c00a9fe9d5 Add notices before public release
Mikael Berthe <mikael@lilotux.net>
parents: 63
diff changeset
     8
-- This program is free software; you can redistribute it and/or modify
d9c00a9fe9d5 Add notices before public release
Mikael Berthe <mikael@lilotux.net>
parents: 63
diff changeset
     9
-- it under the terms of the GNU General Public License as published by
d9c00a9fe9d5 Add notices before public release
Mikael Berthe <mikael@lilotux.net>
parents: 63
diff changeset
    10
-- the Free Software Foundation; either version 2 of the License, or (at
d9c00a9fe9d5 Add notices before public release
Mikael Berthe <mikael@lilotux.net>
parents: 63
diff changeset
    11
-- your option) any later version.
d9c00a9fe9d5 Add notices before public release
Mikael Berthe <mikael@lilotux.net>
parents: 63
diff changeset
    12
--
d9c00a9fe9d5 Add notices before public release
Mikael Berthe <mikael@lilotux.net>
parents: 63
diff changeset
    13
-- Please check the license in the COPYING file at the root of the tree.
d9c00a9fe9d5 Add notices before public release
Mikael Berthe <mikael@lilotux.net>
parents: 63
diff changeset
    14
--
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    15
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    16
require "libs.shcmd"
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    17
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    18
local tvcal = { ["desc"] = "Display TV calendar" }
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    19
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    20
local tvcaldata = {}
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    21
local tvcaldata_timestamp
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    22
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    23
-- Function from PIL
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    24
local function pairsByKeys (t, f)
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    25
    local a = {}
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    26
    for n in pairs(t) do table.insert(a, n) end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    27
    table.sort(a, f)
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    28
    local i = 0      -- iterator variable
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    29
    local iter = function ()   -- iterator function
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    30
        i = i + 1
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    31
        if a[i] == nil then return nil
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    32
        else return a[i], t[a[i]]
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    33
        end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    34
    end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    35
    return iter
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    36
end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    37
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    38
local function parse_webpage (url)
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    39
    local contents = shcmd("curl "..url)
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    40
39
237af42156a1 Add checks after shcmd() calls
Mikael Berthe <mikael@lilotux.net>
parents: 38
diff changeset
    41
    if not contents then
237af42156a1 Add checks after shcmd() calls
Mikael Berthe <mikael@lilotux.net>
parents: 38
diff changeset
    42
        return nil, "Could not fetch calendar, please try again later!"
237af42156a1 Add checks after shcmd() calls
Mikael Berthe <mikael@lilotux.net>
parents: 38
diff changeset
    43
    end
237af42156a1 Add checks after shcmd() calls
Mikael Berthe <mikael@lilotux.net>
parents: 38
diff changeset
    44
61
5d807892b439 tvcal: Work around buggy 0x0d at end of lines
Mikael Berthe <mikael@lilotux.net>
parents: 59
diff changeset
    45
    -- Work around frackin ugly end of line characters... :/
5d807892b439 tvcal: Work around buggy 0x0d at end of lines
Mikael Berthe <mikael@lilotux.net>
parents: 59
diff changeset
    46
    local eol = "[%s"..string.char(13).."]*"
5d807892b439 tvcal: Work around buggy 0x0d at end of lines
Mikael Berthe <mikael@lilotux.net>
parents: 59
diff changeset
    47
58
4c3028c21ccb Sync tvcal module (another website change...)
Mikael Berthe <mikael@lilotux.net>
parents: 57
diff changeset
    48
    -- Regex for each day
4c3028c21ccb Sync tvcal module (another website change...)
Mikael Berthe <mikael@lilotux.net>
parents: 57
diff changeset
    49
    local tabregex = '<td id="d_(%d+_%d+_%d%d%d%d)" class="t?o?day"%s*>'..
4c3028c21ccb Sync tvcal module (another website change...)
Mikael Berthe <mikael@lilotux.net>
parents: 57
diff changeset
    50
                     '%s*(.-)%s*</td>'
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    51
58
4c3028c21ccb Sync tvcal module (another website change...)
Mikael Berthe <mikael@lilotux.net>
parents: 57
diff changeset
    52
    -- Regex for parsing one day
59
0a39d217b80a Fix tvcal regex
Mikael Berthe <mikael@lilotux.net>
parents: 58
diff changeset
    53
    local epregex = '<p[^>]*>'..
61
5d807892b439 tvcal: Work around buggy 0x0d at end of lines
Mikael Berthe <mikael@lilotux.net>
parents: 59
diff changeset
    54
                      '<a href=[^>]+>([^<]+)</a>'..eol..        -- Name
5d807892b439 tvcal: Work around buggy 0x0d at end of lines
Mikael Berthe <mikael@lilotux.net>
parents: 59
diff changeset
    55
                      '<br /><a href=[^>]+>([^<]+)</a>'..eol..  -- Episode
58
4c3028c21ccb Sync tvcal module (another website change...)
Mikael Berthe <mikael@lilotux.net>
parents: 57
diff changeset
    56
                    '</p>'
4c3028c21ccb Sync tvcal module (another website change...)
Mikael Berthe <mikael@lilotux.net>
parents: 57
diff changeset
    57
4c3028c21ccb Sync tvcal module (another website change...)
Mikael Berthe <mikael@lilotux.net>
parents: 57
diff changeset
    58
    -- loop over all days
4c3028c21ccb Sync tvcal module (another website change...)
Mikael Berthe <mikael@lilotux.net>
parents: 57
diff changeset
    59
    for day, daytab in string.gmatch(contents, tabregex) do
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    60
        local d, m, y = day:match("^(%d+)_(%d+)_(%d%d%d%d)$")
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    61
        day = string.format("%04d-%02d-%02d", y, m, d)
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    62
58
4c3028c21ccb Sync tvcal module (another website change...)
Mikael Berthe <mikael@lilotux.net>
parents: 57
diff changeset
    63
        local shows = {}
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    64
58
4c3028c21ccb Sync tvcal module (another website change...)
Mikael Berthe <mikael@lilotux.net>
parents: 57
diff changeset
    65
        -- Loop over all episodes of a day
4c3028c21ccb Sync tvcal module (another website change...)
Mikael Berthe <mikael@lilotux.net>
parents: 57
diff changeset
    66
        for name, ep in string.gmatch(daytab, epregex) do
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    67
            name = name:gsub("&quot;", "\""):gsub("&amp;", "&")
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    68
            name = name:gsub("&lt;", "<"):gsub("&gt;", ">")
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    69
            name = name:gsub("&#39;", "'")
63
31f967ba9e1f tvcal: Remove newlines in episode names
Mikael Berthe <mikael@lilotux.net>
parents: 61
diff changeset
    70
            name = name:gsub("%s*\n%s*", "  ")
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    71
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    72
            local obj = {
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    73
                ["name"] = name,
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    74
                ["ep"] = ep
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    75
                }
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    76
            table.insert(shows, obj)
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    77
        end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    78
        tvcaldata[day] = shows
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    79
    end
58
4c3028c21ccb Sync tvcal module (another website change...)
Mikael Berthe <mikael@lilotux.net>
parents: 57
diff changeset
    80
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    81
    tvcaldata_timestamp = os.date("%F")
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    82
    return true
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    83
end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    84
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    85
local function tvcal_by_date (d)
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    86
    if not tvcaldata[d] then
37
9d7f19e4e4fe Add support for tvcal +n
Mikael Berthe <mikael@lilotux.net>
parents: 36
diff changeset
    87
        return "No episode found for this date ("..d..")"
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    88
    end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    89
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    90
    local r = "Shows on " .. d .. ":\n"
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    91
    for i,j in ipairs(tvcaldata[d]) do
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    92
        r = r .. j.name .. " (" ..j.ep .. ")\n"
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    93
    end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    94
    r = r:gsub("\n+$", "")
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    95
    return r
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    96
end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
    97
38
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
    98
local function tvcal_by_name (name, plain)
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
    99
    local action = plain and "contain" or "match"
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   100
    local r = ""
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   101
    name = name:lower()
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   102
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   103
    for day, obj in pairsByKeys(tvcaldata) do
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   104
        for i,j in ipairs(obj) do
38
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   105
            if j.name:lower():find(name, 1, plain) then
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   106
                r = r .. day .. "\t" .. j.name .. " (" ..j.ep .. ")\n"
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   107
            end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   108
        end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   109
    end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   110
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   111
    if r == "" then
38
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   112
        return "No episode found "..action.."ing this string"
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   113
    end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   114
    r = r:gsub("\n+$", "")
38
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   115
    return "Episodes "..action.."ing \""..name.."\":\n" .. r
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   116
end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   117
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   118
function tvcal.cmd (arg)
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   119
    if not tvcaldata_timestamp or tvcaldata_timestamp ~= os.date("%F") then
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   120
        tvcaldata = {} -- Empty the previous list
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   121
        local r, err = parse_webpage("http://www.pogdesign.co.uk/cat/")
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   122
        if not r then return nil, err end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   123
        -- Fetch next month as well...
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   124
        local m = tonumber(os.date("%m"))+1
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   125
        local y = os.date("%Y")
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   126
        if m > 12 then m = 1; y = y + 1; end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   127
        parse_webpage("http://www.pogdesign.co.uk/cat/"..m.."-"..y)
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   128
    end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   129
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   130
    if not arg or arg == "today" then
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   131
        arg = os.date("%F")
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   132
    elseif arg == "tomorrow" then
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   133
        arg = os.date("%F", os.date("%s")+86400)
37
9d7f19e4e4fe Add support for tvcal +n
Mikael Berthe <mikael@lilotux.net>
parents: 36
diff changeset
   134
    elseif arg:match("^%+%d+$") then
9d7f19e4e4fe Add support for tvcal +n
Mikael Berthe <mikael@lilotux.net>
parents: 36
diff changeset
   135
        local n = tonumber(arg:match("^%+(%d+)$"))
9d7f19e4e4fe Add support for tvcal +n
Mikael Berthe <mikael@lilotux.net>
parents: 36
diff changeset
   136
        if n < 60 then
9d7f19e4e4fe Add support for tvcal +n
Mikael Berthe <mikael@lilotux.net>
parents: 36
diff changeset
   137
            arg = os.date("%F", os.date("%s")+86400*n)
9d7f19e4e4fe Add support for tvcal +n
Mikael Berthe <mikael@lilotux.net>
parents: 36
diff changeset
   138
        end
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   139
    end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   140
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   141
    if arg:match("^%d%d%d%d%-%d%d%-%d%d$") then
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   142
        return tvcal_by_date(arg)
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   143
    end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   144
38
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   145
    -- Is it a pattern? (string surrounded by quotes)
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   146
    local plain = arg:match('^"(.*)"$')
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   147
    if plain then
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   148
        arg = plain
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   149
        plain = false
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   150
    else
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   151
        plain = true
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   152
    end
a51ddbce247b Add regex support to tvcal
Mikael Berthe <mikael@lilotux.net>
parents: 37
diff changeset
   153
    return tvcal_by_name(arg, plain)
36
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   154
end
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   155
2aedd0749666 Actually add tvcal file
Mikael Berthe <mikael@lilotux.net>
parents:
diff changeset
   156
mcbot_register_command("tvcal", tvcal)