#!/bin/bash # # Bashcc 0.1 (13/03/2005) # Tres basique mais suffisant pour poster LOGIN=plop MD5=... UNIQUE_ID=... UA='bashcc-0.1' CURL=`which curl` HEAD=`which head` LYNX=`which lynx` SED=`which sed` TAIL=`which tail` WIDTH='80' TOP='35' BOTTOM=`expr $TOP - 16` NAME='Da Linux French Page' INDEX='http://linuxfr.org/board/index.html' ADD='http://linuxfr.org/board/add.html' if [ "$1" == "-h" -o "$1" == "--help" -o $# -ne 1 ]; then echo "commande: bashcc " echo ": temps de rafraichissement en secondes." echo "ctrl+c pour fermer bashcc." exit 0 fi while : do message=" " clear echo -e "--------------------------------------------------------------------------------" echo -e " $UA < Tribune de $NAME > " echo -e "--------------------------------------------------------------------------------" $LYNX -display_charset=UTF-8 -width=$WIDTH -nolist -dump $INDEX \ | $SED -e '/^$/d' | $SED -e '/^Votre/d' | $SED -e 's/^ //g' \ | $SED -e 's/^ \[..:..:..\]/&/g' \ | $SED -e 's/^ -/&/g' \ | $SED -e 's/\[url]/&/g' \ | $SED -e 's/\\_o " read -r -t $1 message if [ "$message" != " " ]; then $CURL -A $UA -b "login=$LOGIN; md5=$MD5; unique_id=$UNIQUE_ID" -e $INDEX \ -d "message=$message§ion=1" $ADD fi done