add some more search capabilities
Ted Unangst tedu@tedunangst.com
Mon, 03 Jul 2023 00:45:35 -0400
3 files changed,
33 insertions(+),
3 deletions(-)
M
database.go
→
database.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.txt
→
docs/changelog.txt
@@ -2,6 +2,8 @@ changelog
=== next ++ Improved search. + + Tuned up superdeliverator. + Import from instagram.
M
docs/honk.1
→
docs/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.