summaryrefslogtreecommitdiff
path: root/blq
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2020-11-22 18:54:41 +0100
committerJohn Ankarström <john@ankarstrom.se>2020-11-22 18:54:41 +0100
commit3537be9e7c578f8ca84e9d420044654577706a11 (patch)
tree379184e06cf5907b053bb9ff44d639dedd63a9b4 /blq
parent9c9207c0141b816e351c62e659079912367dbeff (diff)
downloadweb-3537be9e7c578f8ca84e9d420044654577706a11.tar.gz
Add more useful headers
Diffstat (limited to 'blq')
-rwxr-xr-xblq10
1 files changed, 6 insertions, 4 deletions
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