rss.lua: Fix funktioniert doch nicht ._.

This commit is contained in:
Akamaru 2016-07-21 13:13:26 +02:00
parent ed4026fd32
commit 783e56fd2f

View File

@ -87,7 +87,9 @@ function cleanRSS(str)
str = string.gsub(str, 'Click for full.', '')
str = string.gsub(str, 'Read more »', '')
str = string.gsub(str, 'Read more', '')
str = string.gsub(str, 'Meldung bei www.tagesschau.de lesen', '')
str = string.gsub(str, '%(more…%)', '')
str = string.gsub(str, 'View on WordPress', '')
str = string.gsub(str, 'Meldung bei www%.tagesschau%.de lesen', '')
return str
end
@ -344,20 +346,20 @@ function rss:cron(self_plz)
local link = v2.link or v2.id or 'Kein Link'
if v2.content then
if string.len(v2.content) > 250 then
content = string.sub(unescape_for_rss(cleanRSS(v2.content):gsub("%b<>", "")), 1, 250) .. '...'
content = string.sub(unescape_for_rss(v2.content:gsub("%b<>", "")), 1, 250) .. '...'
else
content = unescape_for_rss(cleanRSS(v2.content):gsub("%b<>", ""))
content = unescape_for_rss(v2.content:gsub("%b<>", ""))
end
elseif v2.summary then
if string.len(v2.summary) > 250 then
content = string.sub(unescape_for_rss(cleanRSS(v2.summary):gsub("%b<>", "")), 1, 250) .. '...'
content = string.sub(unescape_for_rss(v2.summary:gsub("%b<>", "")), 1, 250) .. '...'
else
content = unescape_for_rss(cleanRSS(v2.summary):gsub("%b<>", ""))
content = unescape_for_rss(v2.summary:gsub("%b<>", ""))
end
else
content = ''
end
content = cleanRSS(content)
text = text..'\n*[*#RSS*] '..title..'*\n'..utilities.trim(utilities.md_escape(content))..' [Weiterlesen]('..link..')\n'
end
if text ~= '' then