Title for site rss feed

main
Bob Mottram 2020-10-13 18:14:57 +01:00
parent 67fa0b5a8f
commit bf1bf3a46d
2 changed files with 7 additions and 4 deletions

View File

@ -4291,7 +4291,7 @@ class PubServer(BaseHTTPRequestHandler):
if msg:
msg = rss2Header(httpPrefix,
'news', domainFull,
'News', translate) + msg + rss2Footer()
'Site', translate) + msg + rss2Footer()
msg = msg.encode('utf-8')
self._set_headers('text/xml', len(msg),

View File

@ -26,14 +26,17 @@ def rss2Header(httpPrefix: str,
rssStr = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>"
rssStr += "<rss version=\"2.0\">"
rssStr += '<channel>'
if title.startswith('News'):
rssStr += ' <title>Newswire</title>'
else:
rssStr += ' <title>' + translate[title] + '</title>'
if title.startswith('News'):
rssStr += ' <link>' + httpPrefix + '://' + domainFull + \
'/newswire.xml' + '</link>'
elif title.startswith('Site'):
rssStr += ' <title>' + domainFull + '</title>'
rssStr += ' <link>' + httpPrefix + '://' + domainFull + \
'/blogs/rss.xml' + '</link>'
else:
rssStr += ' <title>' + translate[title] + '</title>'
rssStr += ' <link>' + httpPrefix + '://' + domainFull + \
'/users/' + nickname + '/rss.xml' + '</link>'
return rssStr