From 3537be9e7c578f8ca84e9d420044654577706a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 22 Nov 2020 18:54:41 +0100 Subject: Add more useful headers --- blq | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'blq') diff --git a/blq b/blq index 1e91ce9..c740ec2 100755 --- a/blq +++ b/blq @@ -1,6 +1,6 @@ #!/bin/sh -# Perform a search on Blocket.se (API v6, Nov 2020) +# Perform a search on Blocket.se (Nov 2020) usage() { echo usage: $0 query 1>&2; exit 1; } @@ -11,10 +11,12 @@ fi # Parse options r= -while getopts rc o +d= +while getopts dr o do case $o in - r) r=1 ;; # process with blm and read in MAILER + d) d=-d ;; # send -d (dumb) option to blm + r) r=-r ;; # process with blm and read in MAILER ?) usage ;; esac done @@ -32,7 +34,7 @@ curl -s -H "authorization: Bearer $tok" "https://api.blocket.se/search_bff/v1/co { test ! -z "$r" && { f=/tmp/blq.$RANDOM - blm > $f + blm $d > $f eval $MAILER -f $f < /dev/tty rm $f } || cat -- cgit v1.2.3