#!/bin/bash CHANNELS="#hikari" SERVER="irc.chatsociety.net" PONGNAME="$SERVERNAME" bot(){ URL=http://torrentdb.ath.cx/?newer="$(date -d "60 minutes ago" +%s)" while sleep 300 ; do # FUCKING MAKE THIS LONGER if you use this script externally (how about 10 minutes?) URL="$( wget -qO /tmp/torrentdb.xml "$URL" && xsltproc torrentdb2bot.xsl /tmp/torrentdb.xml | ( read U echo "$(echo "$URL" | sed "s,/\(?.*\)\?$,/$U,")" while read link && read title ; do echo "PRIVMSG $CHANNELS :New Release: $title <$link>" sleep 2 done >&3 ) )" done } bot 3>&1 | while true ; do ( echo 'USER torrentdb r00t r00t r00t :Joe Smith' echo "NICK torrentdb" echo "JOIN $CHANNELS" echo "PRIVMSG $CHANNELS :hello, i am http://torrentdb.ath.cx/source/bot.bash" while sleep 240 ; do echo "PONG :$PONGNAME" ; done & cat ) | nc -vv "$SERVER" 6667 done