From 8412921315198eac54b654a30065a56bb95e6811 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Tue, 16 Feb 2016 17:14:28 +0100 Subject: [PATCH] Kleine fixes --- plugins/dogify.lua | 16 +++++----------- plugins/rss.lua | 2 +- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/plugins/dogify.lua b/plugins/dogify.lua index 71e47f4..dd221f3 100644 --- a/plugins/dogify.lua +++ b/plugins/dogify.lua @@ -1,15 +1,9 @@ local function run(msg, matches) - local base = "http://dogr.io/" - local path = string.gsub(matches[1], " ", "%%20") - local url = base .. path .. '.png?split=false&.png' - local urlm = "https?://[%%%w-_%.%?%.:/%+=&]+" - - if string.match(url, urlm) == url then - local receiver = get_receiver(msg) - send_photo_from_url(receiver, url) - else - return 'Konnte kein Bild mit "' .. matches[1] .. '" erstellen.' - end + local BASE_URL = "http://dogr.io/" + local path = string.gsub(matches[1], " ", "%%20") + local url = BASE_URL..path..'.png?split=false&.png' + local receiver = get_receiver(msg) + send_photo_from_url(receiver, url) end return { diff --git a/plugins/rss.lua b/plugins/rss.lua index 1fb72f9..59c2f9d 100644 --- a/plugins/rss.lua +++ b/plugins/rss.lua @@ -159,7 +159,7 @@ local function cron() else content = '' end - text = text..'[RSS] '..title..'\n'..content..'\n\n'..link..'\n\n' + text = text..'[#RSS] '..title..'\n'..content..'\n\n'..link..'\n\n' end if text ~= '' then local newlast = newentr[1].id