new stuff
This commit is contained in:
parent
1fe79a6073
commit
f500e68dce
|
@ -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!")
|
1
main
1
main
|
@ -210,6 +210,7 @@ def apifrontpage():
|
||||||
for comment in get_comments(post["id"]):
|
for comment in get_comments(post["id"]):
|
||||||
commentthing = {
|
commentthing = {
|
||||||
"title": comment["textstr"],
|
"title": comment["textstr"],
|
||||||
|
"id": comment["id"],
|
||||||
"created": comment["created"],
|
"created": comment["created"],
|
||||||
"creator": {
|
"creator": {
|
||||||
"id": comment["creator"],
|
"id": comment["creator"],
|
||||||
|
|
Reference in New Issue