This simple script reads a pipe and waits for the EOF then dumps it all out to a IRC server via netcat.
#!/bin/sh
IRCUSER="GANDALF"
IRCNICK="GANDALF"
IRCCHAN="General"
IRCHOST="localhost"
IRCPORT="6667"
irc="USER $IRCUSER * 8 : $IRCUSER Robot\n"
irc+="NICK $IRCNICK\n"
irc+="JOIN #$IRCCHAN\n"
while read mes; do
irc+="NOTICE #General : $mes\n"
done;
irc+="QUIT :Bye for now\n"
echo -e "${irc[*]}" | nc $IRCHOST $IRCPORT