ircのログの取り方

pythonでircのログを取る方法
参考URL
http://www.codereading.com/codereading/python/python-irc-client.html
python version 2.4で検証しました
これをユーザー全員のログファイルが取れるように一部を変更

   if msg [1] == 'PRIVMSG':#この行を変更しました
       filetxt = open('../msg.txt', 'a+') #open an arbitrary file to store the messages
       nick_name = msg[0][:string.find(msg[0],"!")] #if a private message is sent to you catch it
       message = ' '.join(msg[3:])
       filetxt.write(string.lstrip(nick_name, ':') + ' -> ' + string.lstrip(message, ':') + '\n') #write to the file
       filetxt.flush() #don't wait for next message, write it now!

これでみんなのログファイルが取れましたね。
もしhtml内に表示したかったら以下をすればいいと思う
参考URLを
http://www.ajaxtower.jp/ini/html/index1.html
最終更新:2011年06月05日 04:05