From 4f3aef649344e527e9b6a1cccaf20a73790bb179 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Tue, 24 Jan 2017 21:05:40 +0100 Subject: [PATCH] Entferne THC & PonyWave --- miku/plugins/wordpress_posts.lua | 21 +++------------------ 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/miku/plugins/wordpress_posts.lua b/miku/plugins/wordpress_posts.lua index 0a36112..923bf4a 100644 --- a/miku/plugins/wordpress_posts.lua +++ b/miku/plugins/wordpress_posts.lua @@ -2,11 +2,7 @@ local wordpress_recent_post = {} wordpress_recent_post.triggers = { "^/([Aa][Kk][Aa]) (.+)$", - "^/([Tt][Hh][Cc]) (.+)$", - "^/([Pp][Ww]) (.+)$", "^/([Aa][Kk][Aa])$", - "^/([Tt][Hh][Cc])$", - "^/([Pp][Ww])$" } local makeOurDate = function(dateString) @@ -21,11 +17,7 @@ function wordpress_recent_post:get_full_url(blog, tag) else url = blog..'/?json=get_recent_posts' end - local doer = http - if url:match('^https') then - doer = https - end - local res, code = doer.request(url) + local res, code = https.request(url) if code ~= 200 then return nil end local data = json.decode(res).posts[1] if not data then return 'NOTFOUND' end @@ -49,19 +41,12 @@ function wordpress_recent_post:get_full_url(blog, tag) image_url = nil end - local text = ''..title..'\n'..from..' am '..posted_at..''..content..'\nBeitrag aufrufen' + local text = ''..title..'\n'..from..' am '..posted_at..''..content..'\nBeitrag aufrufen.' return text, image_url end function wordpress_recent_post:action(msg, config, matches) - local blog = matches[1] - if blog:match('[Aa][Kk][Aa]') then - blog = 'http://akamaru.de' - elseif blog:match('[Pp][Ww]') then - blog = 'https://ponywave.de' - elseif blog:match('[Tt][Hh][Cc]') then - blog = 'http://homebrew.cloud' - end + local blog = 'https://akamaru.de' local text, image_url = wordpress_recent_post:get_full_url(blog, matches[2]) if not text then utilities.send_reply(msg, config.errors.connection)