From c20f63f762491abc05cefcd110e8423eabda6514 Mon Sep 17 00:00:00 2001 From: Aleteoryx Date: Sat, 23 Nov 2024 03:09:57 -0500 Subject: [PATCH] basic mod tool --- bin/rmpost.tcl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 bin/rmpost.tcl diff --git a/bin/rmpost.tcl b/bin/rmpost.tcl new file mode 100755 index 0000000..7ea0130 --- /dev/null +++ b/bin/rmpost.tcl @@ -0,0 +1,20 @@ +#!/bin/env tclsh + +lassign $argv db feed uri + +cd [file dirname [file dirname [dict get [info frame [info frame]] file]]] + +switch -regexp -matchvar matches -- $uri { + {^at://.+} {} + {^(?:(?:(?:(?:(?:https://)?bsky.app)?/)?profile)?/)?([^/]+)/post/(.+)$} { + lassign $matches pub mkey + set uri at://$pub/app.bsky.feed.post/$mkey + } + default {return -code error "unknown URI format!"} +} + +package require sqlite3 + +sqlite3 db $db + +db eval "DELETE FROM $feed WHERE uri = :uri;" -- 2.45.2