Added live editing (server)

This commit is contained in:
Tracker-Friendly 2024-03-29 19:59:40 +00:00
parent 74049f4ee8
commit 43b7bcebff
2 changed files with 28 additions and 0 deletions

20
cleardb.py Normal file
View File

@ -0,0 +1,20 @@
import time
import subprocess
def run_init_db():
# Run the init_db.py script using subprocess
try:
subprocess.run(["python", "init_db"])
except Exception as e:
print("Error:", e)
def main():
while True:
# Run init_db.py
run_init_db()
# Wait for 5 minutes before running again
time.sleep(300) # 300 seconds = 5 minutes
if __name__ == "__main__":
main()

8
fixapi.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
# Define the old and new URLs
OLD_URL="https://notes.canary.hectabit.org/api"
NEW_URL="https://notes.canary.hectabit.org/api"
# Recursively search and replace in files under the current directory
find . -type f -exec sed -i "s|$OLD_URL|$NEW_URL|g" {} +