diff options
Diffstat (limited to 'blq')
-rwxr-xr-x | blq | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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 |