1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#!/bin/sh
# freshmeat.sh - downloading the headlines of http://freshmeat.net
#
# Copyright (c) 2001,2002 Seiichi SATO <ssato@sh.rim.or.jp>
# licensed under the GPL
#
# <ChangeLog>
# 2002 Jul 20
# * rewritten for fetching rdf file
# * removed lynx
#
# 2002 April 02
# * updated, again.
#
# 2002 April 01
# * updated for new freshmeat.net
#
# 2002 January 27
# * bug fix
# sed 's/.*000000">//g' > $OUTPUT ==> sed 's/.*0">//g' > $OUTPUT
#
# 2001 October 15
# * Initial release
#
URL=http://freshmeat.net/backend/fm.rdf
OUTPUT=${HOME}/.freshmeat
W3M="w3m"
WGET="wget"
LYNX="lynx"
LINKS="links"
if which $W3M > /dev/null 2>&1 ; then
COMMAND="$W3M -dump_source"
elif which $WGET> /dev/null 2>&1 ; then
COMMAND="$WGET --quiet --output-document=-"
elif which $LYNX > /dev/null 2>&1 ; then
COMMAND="$LYNX -source"
elif which $LINKS > /dev/null 2>&1 ; then
COMMAND="$LINKS -source"
else
exit 1
fi
$COMMAND $URL | grep "\<title\>" | grep -v "freshmeat\.net" | \
sed 's/.*<title>//g' | sed 's/<\/title>.*//g' > $OUTPUT
|