Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)
Paste
Pasted as Python by BakaNeko ( 15 years ago )
#!/usr/bin/python
# -*- coding: utf-8 -*
# Love !
#
# Peace !
#
# Shminternetz !
import socket, sys
import urllib, re
from base64 import b64encode, b64decode
from random import sample
portik = '10101'
irc_host = 'irc.underworld.no'
irc_port = 6667
irc_nick = ''.join(unichr(_) for _ in sample( range(48,58)+range(65,91)+range(97,123) ,9 ))
channel = '#world_test_1'
oypeeshkee = []
def get_my_ipv6():
url = 'http://ipv6.whatismyipv6.net/'
try:
tmp = urllib.urlopen(url).read()
except:
sys.exit('[ОШИБКА] Почини ойпи')
my_re = re.compile(r'<h1>(.*?)</h1>')
tmp = re.findall(my_re, tmp)
tmp = tmp[0].split(' ')
tmp = tmp[-1]
return tmp
oypee = get_my_ipv6() + ':' + portik
coded_ip = b64encode(oypee)
print '[ Ойпишнег работоид ] ',oypee
print '[ Ищем пиров...Падаждите чучуть хуле...эта поебень может глючить ]'
irc = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
irc.connect((irc_host, irc_port))
irc.recv(4096)
irc.send( 'NICK '+irc_nick+'\r\n')
irc.send( 'USER kawaii kawaii kawaii :kawaii\r\n' )
irc.send( 'JOIN '+channel+'\r\n' )
irc.send( 'PRIVMSG '+channel+' :\001ACTION прибыл '+coded_ip+' и силён и смел и как вообще\001\r\n')
first_time_names = True
while True:
data = irc.recv(4096)
if data.find('PING')!=-1:
irc.send('PONG '+'\r\n')
elif data.find('PRIVMSG')!=-1:
nick = data.split('!')[0].replace(':', '')
message = ''.join(data.split(':')[2])
# print nick + ': ' + message
elif data.find(irc_nick+' = '+channel)!=-1:
names = data.split('\r\n')
names = names[-2].split(' ')
names = [name.strip('@') for name in names[5:]]
print names
if first_time_names:
irc.send( 'NAMES '+channel+'\r\n')
first_time_names = False
print data
irc.send( 'PART '+channel+'\r\n' )
irc.send( 'QUIT\r\n' )
irc.close()
Revise this Paste