nsbin/get_news-v0.1

22 lines
493 B
Bash
Executable File

#!/bin/sh
#
# Nico Schottelius <nico@schottelius.(net|org)>
# Date: 25-May-2004
# Last Modified:
# Get latest headlines from www.heise.de
#
USERFILE=$HOME/.heise-news
TMP=/tmp/$$-$UID-`date +%s`
# get
curl -s http://www.heise.de | grep '<h3 class="anriss">' | sed 's/.*>\(.*\)<\/a>.*/\1/g' > "$TMP"
if [ ! -f "$USERFILE" ]; then
cat "$TMP"
else
diff -u "$USERFILE" "$TMP" | grep ^+ | grep -v ^+++ | sed 's/^+/Heise News: /g' 2>/dev/null
fi
mv -f "$TMP" "$USERFILE" || rm -f "$TMP"