Upload current progress

This commit is contained in:
2026-01-03 10:23:05 -06:00
commit ec57d94cc0
66 changed files with 4031 additions and 0 deletions

34
watch_changes.py Normal file
View File

@@ -0,0 +1,34 @@
import couchdb
import time
import json
from urllib.parse import quote
# Configuration
user = "admin"
password = "DonCucarach0!?"
ip_address = "100.100.112.48"
port = "5984"
db_name = "obsidiandb"
safe_password = quote(password, safe="")
url = f"http://{user}:{safe_password}@{ip_address}:{port}/"
print("Listening for changes on CouchDB...")
server = couchdb.Server(url)
db = server[db_name]
# Get current update sequence
since = db.info()['update_seq']
print(f"Current Seq: {since}")
# Poll for changes
while True:
changes = db.changes(since=since, feed='longpoll', timeout=10000)
since = changes['last_seq']
for change in changes['results']:
print(f"Change detected! ID: {change['id']}, Deleted: {change.get('deleted', False)}")
# Check if it's one of our moved files
if "05 - fleeting" in change['id'].lower() or "science" in change['id'].lower():
print(" -> RELEVANT FILE CHANGED")
time.sleep(1)