summaryrefslogtreecommitdiff
path: root/remove-all.py
diff options
context:
space:
mode:
authorlamp2023-12-19 20:23:44 +0000
committerlamp2023-12-19 20:23:44 +0000
commitbc3ec6c3ef07c7ad99e834e991c04e5197d86f89 (patch)
treebca2523edfff62c741b8f09fb2da56698a7222e7 /remove-all.py
initmain
Diffstat (limited to 'remove-all.py')
-rwxr-xr-xremove-all.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/remove-all.py b/remove-all.py
new file mode 100755
index 0000000..59ac73a
--- /dev/null
+++ b/remove-all.py
@@ -0,0 +1,27 @@
+#!/usr/bin/env python
+
+# Usage:
+# remove-all.py <instance-url>
+
+import miniflux
+import subprocess
+import sys
+
+MINIFLUX_INSTANCE = sys.argv[1]
+PASS_ENTRY = [x.decode('utf-8') for x in subprocess.check_output(['pass', 'self-hosted/miniflux/web']).splitlines()]
+USER = [x for x in PASS_ENTRY if x.startswith("username:")][0].removeprefix("username:").strip()
+SECRET = PASS_ENTRY[0]
+
+try:
+ client = miniflux.Client(MINIFLUX_INSTANCE, USER, SECRET)
+except Exception as e: print(e)
+
+print("client connected")
+feeds = client.get_feeds()
+print(f"got {len(feeds)} feeds")
+for feed in feeds:
+ try:
+ id = feed['id']
+ print(f"removing feed: {id}")
+ client.delete_feed(id)
+ except Exception as e: print(e)