summaryrefslogtreecommitdiff
path: root/blm
blob: f00e254b3b805ae69b99653c06c51c4126be6036 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/sh

# Format Blocket.se search results as mboxu

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 + ")\" <noreply@localhost>\n" +
	"Subject: " + "(" + (.price.value | tostring) + ") " + .subject + "\n" +
	([.images[].url] | map("X-Image: " + . + "?type=original") | join("\n")) + "\n" +
	"\n" + .body + "\n" +
	"\n"
'