From 850f917b6aaea6f25bab8860ede290eb66fe958b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= Date: Sun, 22 Nov 2020 01:30:55 +0100 Subject: blq: Add -r option The -r option processes the search results with blm and opens the mbox file in a given mail reader. --- blm | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'blm') diff --git a/blm b/blm index 5b70f0d..f00e254 100755 --- a/blm +++ b/blm @@ -1,11 +1,10 @@ #!/bin/sh -# Format Blocket.se search results +# Format Blocket.se search results as mboxu -# Convert json to mbox jq -r '.data[] | "From BLOCKET " + (.list_time | sub("\\+[0-9][0-9]:00$"; "Z") | fromdate | strftime("%a %b %e %T %Y")) + "\n" + - "From: " + .advertiser.name + ", " + .location[0].name + " (" + .advertiser.type + ")\n" + + "From: \"" + .advertiser.name + ", " + .location[0].name + " (" + .advertiser.type + ")\" \n" + "Subject: " + "(" + (.price.value | tostring) + ") " + .subject + "\n" + ([.images[].url] | map("X-Image: " + . + "?type=original") | join("\n")) + "\n" + "\n" + .body + "\n" + -- cgit v1.2.3