all repos — honk @ 57efc76f2d9e84f5c8033990c314bc4ebe2bf391

my fork of honk

add some more search capabilities
Ted Unangst tedu@tedunangst.com
Mon, 03 Jul 2023 00:45:35 -0400
commit

57efc76f2d9e84f5c8033990c314bc4ebe2bf391

parent

47377beb317edc4b5a114d5d0437d5c0b19258de

3 files changed, 33 insertions(+), 3 deletions(-)

jump to
M database.godatabase.go

@@ -303,6 +303,26 @@ }

if t == "" { continue } + if t == "@me" { + queries = append(queries, "whofore = 1") + continue + } + if t == "@self" { + queries = append(queries, "(whofore = 2 or whofore = 3)") + continue + } + if strings.HasPrefix(t, "before:") { + before := t[7:] + queries = append(queries, "dt < ?") + params = append(params, before) + continue + } + if strings.HasPrefix(t, "after:") { + after := t[6:] + queries = append(queries, "dt > ?") + params = append(params, after) + continue + } if strings.HasPrefix(t, "site:") { site := t[5:] site = "%" + site + "%"
M docs/changelog.txtdocs/changelog.txt

@@ -2,6 +2,8 @@ changelog

=== next ++ Improved search. + + Tuned up superdeliverator. + Import from instagram.
M docs/honk.1docs/honk.1

@@ -143,10 +143,18 @@ .Ss Search

Find old honks. It's basic substring match with a few extensions. The following keywords are supported: -.Bl -tag -width honker -.It site +.Bl -tag -width honker: +.It @me +Honks mentioning the user. +.It @self +Honks by the user. +.It before: +Honks posted before YYYY-MM-DD. +.It after: +As above. +.It site: Substring match on the post domain name. -.It honker +.It honker: Exact match, either AP actor or honker nickname. .It - Negate term.