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)