|
@@ -1,6 +1,6 @@
|
1
|
1
|
import time
|
2
|
2
|
import feedparser
|
3
|
|
-from flask import Flask, render_template, redirect, url_for
|
|
3
|
+from flask import Flask, render_template, redirect, url_for, request
|
4
|
4
|
from bs4 import BeautifulSoup
|
5
|
5
|
|
6
|
6
|
# Source: https://lingohub.com/academy/best-practices/rtl-language-list
|
|
@@ -21,6 +21,8 @@ def my_masto_tag(lang, instance, user, tag):
|
21
|
21
|
tag_url = f'https://{instance}/@{user}/tagged/{tag}'
|
22
|
22
|
feed = feedparser.parse(f'{tag_url}.rss')
|
23
|
23
|
hashtag = '#' + tag.lower()
|
|
24
|
+ if request.args.get('reverse',False):
|
|
25
|
+ feed['entries'] = list(reversed(feed['entries']))
|
24
|
26
|
for e in feed['entries']:
|
25
|
27
|
e['date'] = time.strftime('%Y-%m-%d', e['published_parsed'])
|
26
|
28
|
soup = BeautifulSoup(e['description'], 'html.parser')
|