~aleteoryx/tclfeed-bsky

ref: c20f63f762491abc05cefcd110e8423eabda6514 tclfeed-bsky/bin/rmpost.tcl -rwxr-xr-x 480 bytes
c20f63f7Aleteoryx basic mod tool 29 days ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
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;"