Add tsv output to outliner for BOL offers. - annna - Annna the nice friendly bot. HTML git clone git://bitreich.org/annna/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/annna/ DIR Log DIR Files DIR Refs DIR Tags DIR README --- DIR commit 5fdc2df6f37c61708409645c34cfe69c77543269 DIR parent df56cd4e4c18155ad68bd3cf4db8666301d17518 HTML Author: Annna Robert-Houdin <annna@bitreich.org> Date: Fri, 1 Jan 2021 22:15:22 +0100 Add tsv output to outliner for BOL offers. Diffstat: M oneliner | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) --- DIR diff --git a/oneliner b/oneliner @@ -1,5 +1,8 @@ #!/bin/sh +tsvoutput=0 +[ "$1" = "-t" ] && tsvoutput=1 + curl -s https://ascii.co.uk/oneline \ | grep '/oneline/' \ | sed 's,.*href="\(/oneline/[^ "]*\)".*,https://ascii.co.uk\1,' \ @@ -9,6 +12,11 @@ do oneliner="$(curl -s "${uri}" \ | grep '</span></pre></font></div>' \ | sed 's,</span></pre></font></div>,,')" - printf "%s ( %s )\n" "${oneliner}" "${uri}" + if [ $tsvoutput -gt 0 ]; + then + printf "%s\t%s\n" "${oneliner}" "${uri}" + else + printf "%s ( %s )\n" "${oneliner}" "${uri}" + fi done