From 2d0391c5e5846b4544da9fac8889e9f2b8dc78a8 Mon Sep 17 00:00:00 2001 From: manetta Date: Fri, 18 Feb 2022 16:19:30 +0100 Subject: [PATCH] rename feed.rss to feed.rss.xml --- LogBot/logbot.py | 10 +++++----- LogBot/template.html | 2 +- LogBot/template.rss | 4 +++- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/LogBot/logbot.py b/LogBot/logbot.py index 7f75638..7bc59a8 100644 --- a/LogBot/logbot.py +++ b/LogBot/logbot.py @@ -107,13 +107,13 @@ class Logbot(Bot): folder_name = self.db[message.room]["folder"] if "@" in folder_name: # hacky folder_name = self._parse_room_name(folder_name) - feed_path = os.path.join(self.output, folder_name, "feed.rss") + feed_path = os.path.join(self.output, folder_name, "feed.rss.xml") date = datetime.now() template = jinja2.Template(open("template.rss").read()) # self.feedtemplate would be useful to have in the conf with open(feed_path, "w") as out: feed = template.render( log_path=os.path.join("https://vvvvvvaria.org/logs/", folder_name, "index.html"), # hardcoding the url now, self.baseurl would be helpful to have in the conf - feed_path=os.path.join("https://vvvvvvaria.org/logs/", folder_name, "feed.rss"), # hardcoding the url again + feed_path=os.path.join("https://vvvvvvaria.org/logs/", folder_name, "feed.rss.xml"), # hardcoding the url again title=self.db[message.room]["title"], db=self.db[message.room], date=date.strftime("%a, %d %b %Y %H:%M:%S +0100") # timezone is hardcoded now @@ -132,17 +132,17 @@ class Logbot(Bot): new_key = str(int(keys[-1]) + 1) if media_post: self.db[message.room]["messages"][new_key] = {} - self.db[message.room]["messages"][new_key]['post'] = media_post + self.db[message.room]["messages"][new_key]['post'] = bleach.clean(media_post) + self.db[message.room]["messages"][new_key]['date'] = date self.db[message.room]["messages"][new_key]['media'] = {} self.db[message.room]["messages"][new_key]['media']['type'] = media_type self.db[message.room]["messages"][new_key]['media']['url'] = os.path.join("https://vvvvvvaria.org/logs/", media_url) self.db[message.room]["messages"][new_key]['media']['size'] = media_size - self.db[message.room]["messages"][new_key]['date'] = date else: post = message.content.replace("@add ", "") post = self._href_wrap(post) self.db[message.room]["messages"][new_key] = {} - self.db[message.room]["messages"][new_key]['post'] = post + self.db[message.room]["messages"][new_key]['post'] = bleach.clean(post) self.db[message.room]["messages"][new_key]['date'] = date self.db._dumps() diff --git a/LogBot/template.html b/LogBot/template.html index 2eb2b4b..0c3171e 100644 --- a/LogBot/template.html +++ b/LogBot/template.html @@ -8,7 +8,7 @@

{{ title }}

- (Follow this log: RSS) + (Follow this log: RSS)
{% for num in sorted_numbering | reverse %}
diff --git a/LogBot/template.rss b/LogBot/template.rss index 2462fd3..ea2f0e6 100644 --- a/LogBot/template.rss +++ b/LogBot/template.rss @@ -11,7 +11,9 @@ {{ title }} #{{ x }} {{ log_path }}#{{ x }} {{ log_path }}#{{ x }} - + {% if 'media' in post %}{% endif %} LogBot {{ post.date }}