Advertisement
Guest User

[script]Last seen by yowsup

a guest
Sep 20th, 2014
1,433
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.42 KB | None | 0 0
  1. # -*- coding: utf-8 -*-
  2. #!/usr/bin/python
  3.  
  4. #Por Rodrigo Avila - @el_rodrix
  5.  
  6. import argparse, sys, os, csv
  7. from Yowsup.Common.utilities import Utilities
  8. from Yowsup.Common.debugger import Debugger
  9. from Yowsup.Common.constants import Constants
  10. from Yowsup.Contacts.contacts import WAContactsSyncRequest
  11. from Yowsup.connectionmanager import YowsupConnectionManager
  12.  
  13. import threading,time, base64
  14.  
  15. #.....................config.......................
  16.  
  17. nickname = "549XXXXXXXXXX" #Agregar numero movil
  18. username = "549XXXXXXXXXX" #Agregar usuario
  19. password = "XXXXXXXXXXXXXX" #Agregar pass
  20. target = ["549xxxxxxx", "549xxxxxxxx"] #Ingresar los numeros a verificar en esta lista
  21.  
  22. #....................................................................
  23.  
  24. password = base64.b64decode(bytes(password.encode('utf-8')))
  25. jid = range(len(target))
  26. for x in range(0, len(target)):
  27.     jid[x] = "%[email protected]" % target[x]
  28.     print jid[x]
  29. Debugger.enabled = True if '-d' in sys.argv else False
  30.  
  31. def login(username, password):
  32.     print "[] Autenticado como: %s (%s)\n" % (nickname, username)
  33.     methodsInterface.call("auth_login", (username, password))
  34.  
  35. def send(jid, msg):
  36.     methodsInterface.call("message_send", (jid, msg))
  37.  
  38. def onAuthSuccess(username):
  39.     print("Autenticado!!\n\n")
  40.     methodsInterface.call("ready")
  41.     methodsInterface.call("presence_sendAvailableForChat", (nickname,))
  42.     methodsInterface.call("presence_sendAvailable")
  43.     for x in range(0, len(target)):
  44.         methodsInterface.call("presence_request", (jid[x],))
  45.         time.sleep(2)
  46.     t = 5
  47.     i = 0
  48.     while i < t:
  49.         time.sleep(0.5)
  50.         i=i+1
  51.  
  52. def onAuthFailed(username, err):
  53.     print("Auth Failed!")
  54.  
  55. def onPresenceUpdated(jid, lastSeen):
  56.     print time.strftime("Ultima vez en linea hace: %H horas %M minutos", time.gmtime(lastSeen))
  57.  
  58.  
  59. ########################### EVENTOS #############################  
  60. connectionManager = YowsupConnectionManager()
  61. signalsInterface = connectionManager.getSignalsInterface()
  62. methodsInterface = connectionManager.getMethodsInterface()
  63. connectionManager.setAutoPong(True)
  64.  
  65. signalsInterface.registerListener("auth_success", onAuthSuccess)
  66. signalsInterface.registerListener("auth_fail", onAuthFailed)
  67. signalsInterface.registerListener("presence_updated", onPresenceUpdated)
  68. #####################################################################
  69.  
  70. login(username, password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement