Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- # -*- coding: utf-8 -*-
- from random import randint
- import sys, xmpp, os
- def figlet(sender, text=None):
- apl = sender.split("/")
- cmdComand = "figlet " + apl[0]
- figlet = os.popen(cmdComand).read()
- fn = "/home/valar/" + apl[0] + ".txt"
- f = file(fn, 'w')
- f.write(figlet) # schreibe den Text in die Datei
- f.close() # schliesse die Datei
- jid=xmpp.protocol.JID('ad@resse.de')
- 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(), '1234',resource=jid.getResource())
- if not auth:
- print 'could not authenticate!'
- sys.exit()
- print 'authenticated using',auth
- #verbindet, gibt aber keine Fehlermeldung aus.
- #bzw ich weiß nicht was ab hier schief läuft.
- s=xmpp.filetransfer.IBB()
- d=s.PlugIn(cl)
- d=s.OpenStream("ad@resse.de", sender, f)
- id=s.SendHandler(d)
- return "Blablablup"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement