fix: Update now.rss to include better descriptions
All checks were successful
Build Docker / BuildImage (push) Successful in 40s
All checks were successful
Build Docker / BuildImage (push) Successful in 40s
This commit is contained in:
parent
0cef259ecc
commit
a6b488d1a6
@ -634,8 +634,9 @@ def now_old():
|
|||||||
|
|
||||||
@app.route("/now.rss")
|
@app.route("/now.rss")
|
||||||
def now_rss():
|
def now_rss():
|
||||||
host = request.scheme + "://" + request.host
|
host = "https://" + request.host
|
||||||
print(host)
|
if ":" in request.host:
|
||||||
|
host = "http://" + request.host
|
||||||
# Generate RSS feed
|
# Generate RSS feed
|
||||||
now_pages = os.listdir("templates/now")
|
now_pages = os.listdir("templates/now")
|
||||||
now_pages = [
|
now_pages = [
|
||||||
@ -647,7 +648,7 @@ def now_rss():
|
|||||||
link = page.strip(".html")
|
link = page.strip(".html")
|
||||||
date = datetime.datetime.strptime(link, "%y_%m_%d")
|
date = datetime.datetime.strptime(link, "%y_%m_%d")
|
||||||
date = date.strftime("%A, %B %d, %Y")
|
date = date.strftime("%A, %B %d, %Y")
|
||||||
rss += f'<item><title>{date}</title><link>{host}/now/{link}</link><description>{date}</description><guid>{host}/now/{link}</guid></item>'
|
rss += f'<item><title>What\'s Happening {date}</title><link>{host}/now/{link}</link><description>Latest updates for {date}</description><guid>{host}/now/{link}</guid></item>'
|
||||||
rss += "</channel></rss>"
|
rss += "</channel></rss>"
|
||||||
return make_response(rss, 200, {"Content-Type": "application/rss+xml"})
|
return make_response(rss, 200, {"Content-Type": "application/rss+xml"})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user