diff --git a/miku/encoding.lua b/miku/encoding.lua index 0bf959d..8b7233a 100644 --- a/miku/encoding.lua +++ b/miku/encoding.lua @@ -1,7 +1,7 @@ -- See http://www.ascii.cl/htmlcodes.htm -- str = string.gsub(str, '', '') -function encoding(str) +function unescape(str) -- Symbols str = string.gsub(str, ' ', ' ') -- space str = string.gsub(str, '!', '!') -- exclamation point diff --git a/miku/plugins/rss.lua b/miku/plugins/rss.lua index d5d22f1..afef8ef 100644 --- a/miku/plugins/rss.lua +++ b/miku/plugins/rss.lua @@ -310,23 +310,23 @@ function rss:cron(self_plz) local subscribers = {} local text = '' -- Send one message per feed with the latest entries for k2, v2 in pairs(newentr) do - local title = encoding(v2.title) or 'Kein Titel' + local title = unescape(v2.title) or 'Kein Titel' local link = v2.link or v2.id or 'Kein Link' if v2.content then content = v2.content:gsub("%b<>", "") if string.len(v2.content) > 300 then - content = encoding(content) + content = unescape(content) content = string.sub(content, 1, 300)..'...' else - content = encoding(content) + content = unescape(content) end elseif v2.summary then content = v2.summary:gsub("%b<>", "") if string.len(v2.summary) > 300 then - content = encoding(content) + content = unescape(content) content = string.sub(content, 1, 300)..'...' else - content = encoding(content) + content = unescape(content) end else content = '' diff --git a/miku/plugins/wordpress_posts.lua b/miku/plugins/wordpress_posts.lua index 6dc0181..a17267f 100644 --- a/miku/plugins/wordpress_posts.lua +++ b/miku/plugins/wordpress_posts.lua @@ -29,8 +29,8 @@ function wordpress_recent_post:get_full_url(blog, tag) local data = json.decode(res).posts[1] if not data then return 'NOTFOUND' end - local title = encoding(data.title) - local from = encoding(data.author.name) + local title = unescape(data.title) + local from = unescape(data.author.name) local posted_at = makeOurDate(data.date) local content = data.excerpt:match('

(.*)