readme
This commit is contained in:
parent
f9a9166bb6
commit
9d2e163624
BIN
.certificates/gemlog.deadvey.com/cert.der
Normal file
BIN
.certificates/gemlog.deadvey.com/cert.der
Normal file
Binary file not shown.
BIN
.certificates/gemlog.deadvey.com/key.der
Normal file
BIN
.certificates/gemlog.deadvey.com/key.der
Normal file
Binary file not shown.
@ -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?
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user