Created
July 25, 2012 18:40
-
-
Save mynameisfiber/3177797 to your computer and use it in GitHub Desktop.
irc to pubsub
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Publishes IRC messages from a particular channel to a pubsub | |
server="irc.wikimedia.org" | |
channel="#en.wikipedia" | |
pubsub="http://localhost:8080/pub" | |
( echo "USER irc2ps * * :irc2ps_bot | |
NICK irc2ps$RANDOM | |
JOIN $channel"; cat -) | nc $server 6667 | | |
grep "PRIVMSG $channel" | |
while read LINE; do | |
echo $LINE | curl -d @- -s "$pubsub" > /dev/null; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment