trying to WHOIS a site within IRC
- by SourD
if data.find('!whois') != -1:
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("com.whois-servers.net", 43))
s.send('www.msn.com' + "\r\n")
response = ''
while True:
d = s.recv(4096)
response += d
if d == '':
break
s.send('PRIVMSG ' + chan + " " + response + '\r\n')
s.close()
when I type !whois on the channel, it doesnt do anything, I'm probably doing this wrong. Any help will be appreciate it. Thanks.
Note: There's another socket already connected.