How I can show only "lastseen" in console?
I want to develop a script that only returns "lastseen" a number of whatsapp. I try to call the method self.methodsInterface.call ("presence_request" (self.jid,)), but returns nothing. As I can do? What am I doing wrong?
Hello,
I'm developing something similar. I have been working with the "CmdClient.py" in "def OnPresenceUpdated" and I got some results like if someone is online and his/her last connection hour but recently this command (/lastseen) doesn't work very well to me.
Good luck :)
Where are you from ?
I'm from Spain so sorry for my English level.
okey, no hay drama. Hablo español tambien. Hasta el momento el lastseen me funciona bien. Lo estoy trabajando todavia. Que es lo hace tu script? o que es lo queres hacer con el lastseen?
Yo necesito obtener la hora de la última conexión de un usuario, por lo tanto he automatizado el script con ese objetivo olvidándome de la función de "chat".
Tengo un script que hace lo mismo, solo que le mando como parametro un archivo que contiene un listado de numeros para que me devuelva la ultima conexion, y los guardo en otro archivo. Hasta el momento funciona bien, es mas, a los numeros que no me devuelve la ult conexion los guardo para volver a pasarme el script, con el fin de verificar nuevamente esos numeros.
¿Y te funciona continuamente? Porque últimamente yowsup sólo me responde la última hora de conexión la primera vez.. Si aborto el programa y lo vuelvo a abrir se queda como "congelado" (no responde nada). Hasta que no pasan unos 5 minutos no vuelve a funcionar y realmente me urge porque lo necesito para un proyecto.
Si, hasta el momento funciona bien. Lo unico que hice es llamar al metodo presence_request .. self.methodsInterface.call("presence_request", ( self.jid,)) .. y me devuelve la ultima conexion.
Reference connectionmanager And line 376. Maybe you have an coding error. I'll make a simple script for you. Im Spanish too, but i prefer to write it in english so that other can understand and solve the same issue.
This in connectionmanager:
self.methodInterface.registerCallback("presence_request",self.getLastOnline)
def getLastOnline(self,jid):
if len(jid.split('-')) == 2 or jid == "[email protected]":
return
self.sendSubscribe(jid);
self._d("presence request Initiated for %s"%(jid))
idx = self.makeId("last_")
self.readerThread.requests[idx] = self.readerThread.parseLastOnline;
query = ProtocolTreeNode("query",{"xmlns":"jabber:iq:last"});
iqNode = ProtocolTreeNode("iq",{"id":idx,"type":"get","to":jid},[query]);
self._writeNode(iqNode)
mgp25, Can I contact you (by another way) to speak into spanish? I'm having some questions not related to this topic but the yowsup library.
mgp25, I would like to contact you to resolve problems with my code. I hope not to bother.
Sure, in my profile page you will find my mail
mgp25, I sent an email in Spanish
I didnt receive any email, check if you have sent it to the right email
I'm from Spain (sorry form my awful English level -.-" ) On elrodrix [email protected], 03/07/2014 22:56 wrote:Where are you from ?
—Reply to this email directly or view it on GitHub.