# -*- coding: utf-8 -*-
import sys, os, xmpp, time
#id2084081@vk.com
#id82136693@vk.com
tojid="MegaAccount@jabber.ru"
text="MegaMegaMegaMega"
jidparams={"jid":"МОЙ_АККАУНТ@jabber.ru", "password":"qweasdzxc"}
jid=xmpp.protocol.JID(jidparams['jid'])
cl=xmpp.Client(jid.getDomain(),debug=[])
con=cl.connect()
if not con:
print 'could not connect!'
sys.exit()
print 'connected with',con
auth=cl.auth(jid.getNode(),jidparams['password'],resource=jid.getResource())
if not auth:
print 'could not authenticate!'
sys.exit()
print 'authenticated using',auth
#cl.SendInitPresence(requestRoster=0) # you may need to uncomment this for old server
id=cl.send(xmpp.protocol.Message(tojid,text))
print 'sent message with id',id
time.sleep(1) # some older servers will not send the message if you disconnect immediately after sending
#cl.disconnect()
Говорит такую вещь:
C:\Python26\lib\site-packages\xmpp\auth.py:24: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
import sha,base64,random,dispatcher,re
C:\Python26\lib\site-packages\xmpp\auth.py:26: DeprecationWarning: the md5 module is deprecated; use hashlib instead
import md5
C:\Python26\lib\site-packages\xmpp\transports.py:305: DeprecationWarning: socket.ssl() is deprecated. Use ssl.wrap_socket() instead.
tcpsock._sslObj = socket.ssl(tcpsock._sock, None, None)
connected with tls
Traceback (most recent call last):
File “C:\Documents and Settings\�������������\workspace\Spammer\src\main.py”, line 22, in <module>
auth=cl.auth(jid.getNode(),jidparams,resource=jid.getResource())
File “C:\Python26\lib\site-packages\xmpp\client.py”, line 224, in auth
if self.Bind.Bind(resource):
File “C:\Python26\lib\site-packages\xmpp\auth.py”, line 247, in Bind
jid=JID(resp.getTag('bind').getTagData('jid'))
File “C:\Python26\lib\site-packages\xmpp\protocol.py”, line 233, in __init__
if not jid and not domain: raise ValueError('JID must contain at least domain name')
ValueError: JID must contain at least domain name
Что же мне делать и как же мне быть?