rss.lua: Code "verschönert"

This commit is contained in:
Akamaru 2015-12-01 20:53:35 +01:00
parent 1965853444
commit 4d0d39fb41

View File

@ -14,7 +14,7 @@ local function unescape_for_rss(str)
str = string.gsub(str, "ß", "ß") str = string.gsub(str, "ß", "ß")
str = string.gsub(str, "'", "'") str = string.gsub(str, "'", "'")
str = string.gsub(str, "|", "|") str = string.gsub(str, "|", "|")
str = string.gsub(str, " ", " ") str = string.gsub(str, " ", " ")
str = string.gsub(str, "»", "»") str = string.gsub(str, "»", "»")
str = string.gsub(str, "ß", "ß") str = string.gsub(str, "ß", "ß")
str = string.gsub(str, "–", "") str = string.gsub(str, "–", "")
@ -165,7 +165,6 @@ local function unsubscribe(id, n)
end end
local function cron() local function cron()
-- sync every 15 mins?
local keys = redis:keys(get_base_redis("*", "subs")) local keys = redis:keys(get_base_redis("*", "subs"))
for k,v in pairs(keys) do for k,v in pairs(keys) do
local base = string.match(v, "rss:(.+):subs") -- Get the URL base local base = string.match(v, "rss:(.+):subs") -- Get the URL base
@ -190,7 +189,7 @@ local function cron()
else else
content = '' content = ''
end end
text = text .. '[RSS] '.. title .. '\n'..content..'\n\n' .. link .. '\n\n' text = text..'[RSS] '..title..'\n'..content..'\n\n'..link..'\n\n'
end end
if text ~= '' then if text ~= '' then
local newlast = newentr[1].id local newlast = newentr[1].id