diff options
author | John Ankarström <john@ankarstrom.se> | 2020-11-22 18:54:41 +0100 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2020-11-22 18:54:41 +0100 |
commit | 3537be9e7c578f8ca84e9d420044654577706a11 (patch) | |
tree | 379184e06cf5907b053bb9ff44d639dedd63a9b4 /blq | |
parent | 9c9207c0141b816e351c62e659079912367dbeff (diff) | |
download | web-3537be9e7c578f8ca84e9d420044654577706a11.tar.gz |
Add more useful headers
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 |