venomous0x / WhatsAPI

Interface to WhatsApp Messenger
2.59k stars 2.13k forks source link

Getting online status - New #1005

Open edenalon opened 10 years ago

edenalon commented 10 years ago

Further to previous problems, I went through them and still have not found a way to get if the user online. The last code I tried was:

function onPresenceReceived($mynumber, $from, $type) { echo "\n\nReceived presence from $from. He/she is now $type\n\n"; } $w = new WhatsProt($username, $identity, $nickname, $debug); $w->eventManager()->bind("onGetPresence", "onPresenceReceived");

$w->connect(); $w->loginWithPassword($password); //$w->sendClientConfig(); //$w->sendGetServerProperties(); //$w->SendPresenceSubscription($target);

$w->PollMessages(); $w->SendPresenceSubscription($target);

for($i = 0; $i < 5; $i++) { $w->PollMessages(); }

and it doesnt work anymore .

someone can help me pls ?

Thanks !

edenalon commented 10 years ago

Important: I found a way to get the "Last Seen", but it is only updated when the user disconnects from whatsapp. I am looking for a way to get the moment it connects, or check whether it is online now.

Thank you!

mgp25 commented 10 years ago

Check this tool: https://github.com/mgp25/WhatsApp-Tracker

edenalon commented 10 years ago

Hi , I tried this script , but I run it on my server without ssh . and I dont know how use it .. installed here : http://megaupload.co.il/Whatsapp/status/watracker.php can you help me pls ? Thanks !

edenalon commented 10 years ago

Also , the output is : without any "$presence" = "available" .. you can check it here: http://megaupload.co.il/Whatsapp/src1/new.php Thanks

mgp25 commented 10 years ago

Its usage can be found in the Readme (main page) of WhatsApp Tracker repository..

edenalon commented 10 years ago

I know but I run it on browser with server . I cant use this CLI

mgp25 commented 10 years ago

Then run in on your desktop..

edenalon commented 10 years ago

I cant , I will use it via web and get/post .. you can help me to do it ? I can pay you for support me if you wanne - we can talk in email .