mcbot/cmds/mcabber_bts.lua
changeset 49 4f7fc5acf33d
parent 48 eb9d9603731f
child 66 d9c00a9fe9d5
equal deleted inserted replaced
48:eb9d9603731f 49:4f7fc5acf33d
    13     local issue = {}
    13     local issue = {}
    14     local btsurl = "https://bitbucket.org/McKael/mcabber-crew/issue/"
    14     local btsurl = "https://bitbucket.org/McKael/mcabber-crew/issue/"
    15 
    15 
    16     issue.id = tostring(num)
    16     issue.id = tostring(num)
    17     issue.url = btsurl..issue.id.."/"
    17     issue.url = btsurl..issue.id.."/"
    18     local data = shcmd("curl "..issue.url)
    18     local data = shcmd("curl -k "..issue.url)
    19     if not data then return nil end
    19     if not data then return nil end
    20     local title = data:match("#"..issue.id.."%s*-%s*(.*)%s*—")
    20     local title = data:match("#"..issue.id.."%s*-%s*(.*)%s*—")
    21     if not title then return nil end
    21     if not title then return nil end
    22     issue.title = title:gsub(""", "\""):gsub("&", "&")
    22     issue.title = title:gsub(""", "\""):gsub("&", "&")
    23     issue.title = issue.title:gsub("&lt;", "<"):gsub("&gt;", ">")
    23     issue.title = issue.title:gsub("&lt;", "<"):gsub("&gt;", ">")