nostril-query: add kinds

This commit is contained in:
William Casarin 2022-11-17 18:12:56 -08:00
parent f4325e89f5
commit 0aaf9eb263
4 changed files with 8 additions and 3 deletions

View File

@ -24,8 +24,8 @@ dist: docs version
cd dist;\
sha256sum *.tar.gz > SHA256SUMS.txt;\
gpg -u 0x8A478B64FFE30F1095A8736BF5F27EFD1B38DABB --sign --armor --detach-sig --output SHA256SUMS.txt.asc SHA256SUMS.txt
cp CHANGELOG dist/CHANGELOG.txt
rsync -avzP dist/ charon:/www/cdn.jb55.com/tarballs/nostril/
scp CHANGELOG charon:/www/cdn.jb55.com/tarballs/nostril/CHANGELOG.txt
deps/secp256k1/.git:
@devtools/refresh-submodules.sh $(SUBMODULES)
@ -57,6 +57,7 @@ nostril: $(HEADERS) $(OBJS) $(ARS)
install: all
install -Dm644 doc/nostril.1 $(PREFIX)/share/man/man1/nostril.1
install -Dm755 nostril $(PREFIX)/bin/nostril
install -Dm755 nostril-query $(PREFIX)/bin/nostril-query
config.h: configurator
./configurator > $@

View File

@ -10,6 +10,7 @@ parser.add_argument('-p', '--mentions')
parser.add_argument('-e', '--references')
parser.add_argument('-t', '--hashtag')
parser.add_argument('-i', '--ids')
parser.add_argument('-k', '--kinds')
parser.add_argument('-g',
'--generic',
nargs=2,
@ -47,6 +48,9 @@ if args.mentions:
if args.references:
filt["#e"] = args.references.split(",")
if args.kinds:
kinds = args.kinds.split(",")
filt["kinds"] = [a for a in map(lambda s: int(s), kinds)]
q = json.dumps(["REQ","nostril-query",filt])
print(q)

View File

@ -19,7 +19,7 @@
#include "random.h"
#include "proof.h"
#define VERSION "0.1.0"
#define VERSION "0.1.2"
#define MAX_TAGS 32
#define MAX_TAG_ELEMS 16

View File

@ -126,7 +126,7 @@ fi
evid=$(jq -r '
def tag(name): .tags[] | select(.[0] == name) | .[1];
. | [(.created_at | tostring), (.|tag("t")), (.|tag("author")), (.|tag("subject")), .pubkey[0:20], "id:\(.id)"] | @tsv' "$outname" |
. | [(.created_at | tostring), (.|tag("t")), (.|tag("subject")), (.|tag("author")), .pubkey[0:20], "id:\(.id)"] | @tsv' "$outname" |
sort -rn |
$dateformatter |
column -t -s $'\t' |