Skip to content

Instantly share code, notes, and snippets.

@EntityReborn
Created July 16, 2011 18:41
Show Gist options
  • Save EntityReborn/1086629 to your computer and use it in GitHub Desktop.
Save EntityReborn/1086629 to your computer and use it in GitHub Desktop.
s = __import__("socket").socket()
s.connect(("irc.freenode.net", 6667))
s.send("NICK __import__\r\n")
s.send("USER __import__ irc.freenode.net bla :__import__\r\n")
readbuffer = ""
while True:
readbuffer += s.recv(1024)
temp = readbuffer.split("\n")
readbuffer = temp.pop()
for line in temp:
line = line.strip().split()
if(line[0]=="PING"):
s.send("PONG %s\r\n" % line[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment