CODE
import sys
import socket
import string
HOST="irc.freenode.net"
PORT=6667
NICK=b"MauBot"
IDENT="maubot"
REALNAME="MauritsBot"
readbuffer=""
s=socket.socket( )
s.connect((HOST, PORT))
s.send(b"NICK %s\r\n" + NICK)
s.send(b"USER ha haa bla :hahaha\r\n")
while 1:
readbuffer=readbuffer+s.recv(1024)
temp=string.split(readbuffer, "\n")
readbuffer=temp.pop( )
for line in temp:
line=string.rstrip(line)
line=string.split(line)
if(line[0]=="PING"):
s.send("PONG %s\r\n" % line[1])
import socket
import string
HOST="irc.freenode.net"
PORT=6667
NICK=b"MauBot"
IDENT="maubot"
REALNAME="MauritsBot"
readbuffer=""
s=socket.socket( )
s.connect((HOST, PORT))
s.send(b"NICK %s\r\n" + NICK)
s.send(b"USER ha haa bla :hahaha\r\n")
while 1:
readbuffer=readbuffer+s.recv(1024)
temp=string.split(readbuffer, "\n")
readbuffer=temp.pop( )
for line in temp:
line=string.rstrip(line)
line=string.split(line)
if(line[0]=="PING"):
s.send("PONG %s\r\n" % line[1])
this seems to have been written in 2.6
can someone convert to python 3.1?