Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- #!/usr/bin/python
- #Por Rodrigo Avila - @el_rodrix
- #rodrigo398@hotmail.com
- import argparse, sys, os, csv
- from Yowsup.Common.utilities import Utilities
- from Yowsup.Common.debugger import Debugger
- from Yowsup.Common.constants import Constants
- from Yowsup.Contacts.contacts import WAContactsSyncRequest
- from Yowsup.connectionmanager import YowsupConnectionManager
- import threading,time, base64
- #.....................config.......................
- nickname = "549XXXXXXXXXX" #Agregar numero movil
- username = "549XXXXXXXXXX" #Agregar usuario
- password = "XXXXXXXXXXXXXX" #Agregar pass
- target = ["549xxxxxxx", "549xxxxxxxx"] #Ingresar los numeros a verificar en esta lista
- #....................................................................
- password = base64.b64decode(bytes(password.encode('utf-8')))
- jid = range(len(target))
- for x in range(0, len(target)):
- jid[x] = "%s@s.whatsapp.net" % target[x]
- print jid[x]
- Debugger.enabled = True if '-d' in sys.argv else False
- def login(username, password):
- print "[] Autenticado como: %s (%s)\n" % (nickname, username)
- methodsInterface.call("auth_login", (username, password))
- def send(jid, msg):
- methodsInterface.call("message_send", (jid, msg))
- def onAuthSuccess(username):
- print("Autenticado!!\n\n")
- methodsInterface.call("ready")
- methodsInterface.call("presence_sendAvailableForChat", (nickname,))
- methodsInterface.call("presence_sendAvailable")
- for x in range(0, len(target)):
- methodsInterface.call("presence_request", (jid[x],))
- time.sleep(2)
- t = 5
- i = 0
- while i < t:
- time.sleep(0.5)
- i=i+1
- def onAuthFailed(username, err):
- print("Auth Failed!")
- def onPresenceUpdated(jid, lastSeen):
- print time.strftime("Ultima vez en linea hace: %H horas %M minutos", time.gmtime(lastSeen))
- ########################### EVENTOS #############################
- connectionManager = YowsupConnectionManager()
- signalsInterface = connectionManager.getSignalsInterface()
- methodsInterface = connectionManager.getMethodsInterface()
- connectionManager.setAutoPong(True)
- signalsInterface.registerListener("auth_success", onAuthSuccess)
- signalsInterface.registerListener("auth_fail", onAuthFailed)
- signalsInterface.registerListener("presence_updated", onPresenceUpdated)
- #####################################################################
- login(username, password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement