#!/usr/bin/env bash
# This small in-house script takes the output of a text-based news bot at:
#
# bot@happynetbox.com (via goose@happynetbox.com)
#
# makes the links clickable using the built-in renderer in nf (netfinger)
# and reformats the output using sed.
# the autogenerated filename is a timestamp. This allows for multiple runs
# during the day without overwriting the previous check if desired.
# requirements: nf and browser (firefox is the default)
timestamp=$(date +%Y.%m.%d-%H.%M)
nf -r bot@happynetbox.com > $timestamp.htm && sed -i 's| - |
|g; s|(()|)
|g; s|news:|news:
|' $timestamp.htm && firefox $timestamp.htm
# To delete the file after the browser closes, uncomment below:
# rm "$timestamp.htm"