diff --git a/.certificates/gemlog.deadvey.com/cert.der b/.certificates/gemlog.deadvey.com/cert.der new file mode 100644 index 0000000..e1ada1a Binary files /dev/null and b/.certificates/gemlog.deadvey.com/cert.der differ diff --git a/.certificates/gemlog.deadvey.com/key.der b/.certificates/gemlog.deadvey.com/key.der new file mode 100644 index 0000000..0da70ce Binary files /dev/null and b/.certificates/gemlog.deadvey.com/key.der differ diff --git a/README.md b/README.md index 2a4bd63..e74ba62 100755 --- a/README.md +++ b/README.md @@ -11,3 +11,6 @@ USE glogger; CREATE TABLE users ( userID INT PRIMARY KEY AUTO_INCREMENT NOT NULL, username VARCHAR(255) ); CREATE TABLE posts ( postID INT PRIMARY KEY AUTO_INCREMENT NOT NULL, userID INT, FOREIGN KEY(userID) REFERENCES users(userID), title VARCHAR(255), content TEXT, pubDate VARCHAR(255), editDate VARCHAR(255) ); ``` +# TO DO +* Add RSS and/or ATOM support +* Make it more reliable? diff --git a/create_pages.py b/create_pages.py index fc3b87a..49d5086 100644 --- a/create_pages.py +++ b/create_pages.py @@ -39,15 +39,15 @@ def create_post_page(post, db): def create_timeline(db): with open(f"{config.webroot}/index.gmi", "w") as timeline_file: - output.log("Writing posts to timeline") - users = [] - cursor = db.cursor() - cursor.execute(f"SELECT userName FROM users") - for x in cursor: - users += x - cursor.execute(f"SELECT * FROM posts ORDER BY postID Desc LIMIT {config.posts_in_timeline}") - for x in cursor: - username = users[x[1]-1] - post = config.timeline_post_format - post = parse_post.parse_post_format(post, x, username) - timeline_file.write(post) + output.log("Writing posts to timeline") + users = [] + cursor = db.cursor() + cursor.execute(f"SELECT userName FROM users") + for x in cursor: + users += x + cursor.execute(f"SELECT * FROM posts ORDER BY postID Desc LIMIT {config.posts_in_timeline}") + for x in cursor: + username = users[x[1]-1] + post = config.timeline_post_format + post = parse_post.parse_post_format(post, x, username) + timeline_file.write(post)