diff --git a/deletecomment b/deletecomment new file mode 100644 index 0000000..7f3ec94 --- /dev/null +++ b/deletecomment @@ -0,0 +1,16 @@ +#!/usr/bin/python3 +import sqlite3 +import os + +commentid = input("Insert ID: ") + +def get_db_connection(): + conn = sqlite3.connect("database.db") + conn.row_factory = sqlite3.Row + return conn + +conn = get_db_connection() +conn.execute("DELETE FROM comments WHERE id = ?", (commentid)) +conn.commit() +conn.close() +print("Success!") \ No newline at end of file diff --git a/main b/main index 1be83c1..983db38 100644 --- a/main +++ b/main @@ -210,6 +210,7 @@ def apifrontpage(): for comment in get_comments(post["id"]): commentthing = { "title": comment["textstr"], + "id": comment["id"], "created": comment["created"], "creator": { "id": comment["creator"],