Add option to limit to posts since date

This commit is contained in:
Scott Weldon 2023-05-06 22:25:44 -07:00
parent 65c7077cce
commit e1cfe8045a

View File

@ -17,6 +17,7 @@ parser.add_argument('-g',
metavar=('tag', 'value'), metavar=('tag', 'value'),
help="Generic tag query: `#<tag>: value`") help="Generic tag query: `#<tag>: value`")
parser.add_argument('-l', '--limit', type=int) parser.add_argument('-l', '--limit', type=int)
parser.add_argument('-s', '--since', type=int)
def usage(): def usage():
parser.print_help() parser.print_help()
@ -52,5 +53,8 @@ if args.kinds is not None:
kinds = args.kinds.split(",") kinds = args.kinds.split(",")
filt["kinds"] = [a for a in map(lambda s: int(s), kinds)] filt["kinds"] = [a for a in map(lambda s: int(s), kinds)]
if args.since is not None:
filt["since"] = args.since
q = json.dumps(["REQ","nostril-query",filt]) q = json.dumps(["REQ","nostril-query",filt])
print(q) print(q)