File:  [Local Repository] / reports / sendcalendar.sh
Revision 1.5: download - view: text, annotated - select for diffs - revision graph
Tue Aug 21 03:57:16 2007 UTC (16 years, 8 months ago) by boris
Branches: MAIN
CVS tags: HEAD
New info

#!/bin/sh
ADDRESS="chronicles@chgk.info"
#ADDRESS=boris
URL=http://letopis.chgk.info/calendar.html

echo "Sending notification to $ADDRESS"
echo > calendar.txt
echo "Текущий календарь по данным $URL:" >> calendar.txt
echo >> calendar.txt
sed '
1,/<table/d
/<\/table/,$d
/^<!--/d
s/<tr>/\./
s/<[^>]*>//g
s/<[^>]*$//g
s/^[^<]*>//g
s/&lt;[a-zA-Z\._0-9-]*@[a-zA-Z\._0-9-]*&gt;/<address>/g
/^[ 	]*$/d
s/^.$//' calendar.html>> calendar.txt
echo >> calendar.txt
echo "--" >> calendar.txt
echo "Ваш робот" >> calendar.txt
echo >> calendar.txt
fortune lec >> calendar.txt
mail -s "Novosti v kalendare" $ADDRESS < calendar.txt

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>