yowsup icon indicating copy to clipboard operation
yowsup copied to clipboard

How I can show only "lastseen" in console?

Open elrodrix opened this issue 12 years ago • 15 comments

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?

elrodrix avatar Jun 26 '14 02:06 elrodrix

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 :)

alegr3 avatar Jul 03 '14 17:07 alegr3

Where are you from ?

elrodrix avatar Jul 03 '14 20:07 elrodrix

I'm from Spain so sorry for my English level.

alegr3 avatar Jul 03 '14 22:07 alegr3

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?

elrodrix avatar Jul 03 '14 22:07 elrodrix

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".

alegr3 avatar Jul 04 '14 10:07 alegr3

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.

elrodrix avatar Jul 04 '14 11:07 elrodrix

¿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.

alegr3 avatar Jul 04 '14 11:07 alegr3

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.

elrodrix avatar Jul 04 '14 11:07 elrodrix

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 avatar Jul 04 '14 11:07 mgp25

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.

alegr3 avatar Jul 04 '14 12:07 alegr3

mgp25, I would like to contact you to resolve problems with my code. I hope not to bother.

elrodrix avatar Jul 04 '14 13:07 elrodrix

Sure, in my profile page you will find my mail

mgp25 avatar Jul 04 '14 13:07 mgp25

mgp25, I sent an email in Spanish

elrodrix avatar Jul 04 '14 21:07 elrodrix

I didnt receive any email, check if you have sent it to the right email

mgp25 avatar Jul 04 '14 22:07 mgp25

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.

alegr3 avatar Jul 05 '14 13:07 alegr3