~aleteoryx/tclfeed-bsky

c20f63f762491abc05cefcd110e8423eabda6514 — Aleteoryx 29 days ago b3ea74c
basic mod tool
1 files changed, 20 insertions(+), 0 deletions(-)

A bin/rmpost.tcl
A bin/rmpost.tcl => bin/rmpost.tcl +20 -0
@@ 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;"