diff --git a/src/app.py b/src/app.py index 2c3bf94..a8bc10f 100644 --- a/src/app.py +++ b/src/app.py @@ -55,6 +55,8 @@ def entry(ident): abort(404) +@app.route("/feed") +@app.route("/rss") @app.route("/feed.xml") @app.route("/rss.xml") def feed(): diff --git a/src/content.py b/src/content.py index 4842c5a..3aedf6c 100644 --- a/src/content.py +++ b/src/content.py @@ -1,3 +1,4 @@ +import config from database import Database db = Database() @@ -113,4 +114,26 @@ def get_rss_string(): Returns: string: rss-string of everything that is in the ENTRY_DIR. """ - return "" + content_string = "" + entries = db.get_entries() + if entries is None: + return "" + entries.reverse() + for entry in entries: + ident = entry[0] + title = entry[1] + year = entry[2] + text = entry[3] + rating = entry[4] + username = db.get_user_by_id(entry[5])[1] + reviewed = entry[6] + content_string += "\n" + content_string += "" + title + "(" + year + ") " + str(rating) + "/100 \n" + content_string += "" + config.WEBSITE + \ + "/index.html#" + str(ident) + "\n" + content_string += "" + reviewed + "\n" + content_string += "" + content_string += text + content_string += "\n" + content_string += "\n" + return content_string