TechZone Posted November 22, 2006 Share Posted November 22, 2006 I am looking for a way to interface with MSN (the protocol) via PHP (send messages, detect when a message is received, etc.). Any way(s) to do this? Link to comment https://forums.phpfreaks.com/topic/28045-msn-via-php/ Share on other sites More sharing options...
printf Posted November 22, 2006 Share Posted November 22, 2006 Only via COM or .NET using PHP from a Windows Server...printf Link to comment https://forums.phpfreaks.com/topic/28045-msn-via-php/#findComment-128360 Share on other sites More sharing options...
trq Posted November 22, 2006 Share Posted November 22, 2006 [quote]Only via COM or .NET using PHP from a Windows Server...[/quote]Bollocks. Its just a protocol like any other. If your keen enough it can be done with sockets. However, there doesn't seem to be a great deal of documentation around for it (per usual MS style) and I haven't seen it implimented in php yet. There is a module for Python though called [url=http://auriga.wearlab.de/~alb/msnlib/]libmsn[/url] which comes complete with a simple msn client. You might be able to get some ideas from that. Link to comment https://forums.phpfreaks.com/topic/28045-msn-via-php/#findComment-128365 Share on other sites More sharing options...
printf Posted November 22, 2006 Share Posted November 22, 2006 Bollocks, no at all, just knowledge to state the facts...You can't do it with a script based PHP socket, no matter what you think. It would primitive at best, because PHP sockets is not as robust as you seem to believe.printf Link to comment https://forums.phpfreaks.com/topic/28045-msn-via-php/#findComment-128374 Share on other sites More sharing options...
TechZone Posted November 22, 2006 Author Share Posted November 22, 2006 A socket would be enough to do what I need to (send messages, get contact list, await messages)I dont want to interface with the PROGRAM, just the PROTOCOL Link to comment https://forums.phpfreaks.com/topic/28045-msn-via-php/#findComment-128574 Share on other sites More sharing options...
trq Posted November 22, 2006 Share Posted November 22, 2006 [quote]It would primitive at best, because PHP sockets is not as robust as you seem to believe.[/quote]In what way are they not as robust as I believe? Ive worked with webservers written using php's socket functionality and as far as I can tell they are plenty robust enough.And.... well what do y'know? Someone [i]has[/i] implimented the MSN potocol in php. [url=http://flumpcakes.co.uk/php/msn-messenger]Linky[/url]. Link to comment https://forums.phpfreaks.com/topic/28045-msn-via-php/#findComment-128818 Share on other sites More sharing options...
TechZone Posted November 23, 2006 Author Share Posted November 23, 2006 I knew about that class, but how do I:A) Use itB) Make one of my own? Link to comment https://forums.phpfreaks.com/topic/28045-msn-via-php/#findComment-129201 Share on other sites More sharing options...
TechZone Posted November 24, 2006 Author Share Posted November 24, 2006 Interesting...I tried to use this class, and I ALWAYS get an auth failed error...the passcode is right (checked with MSN messenger)EDIT: Looked into the code...seems like there is a problem with the private function _ssl_auth where it cannot return the right authentication string(s)...that is causing it to return false which generated the auth failed error...any ideas on fixing? The code is here:[code] function _ssl_auth($auth_string) { if (empty($ssh_login)) { if ($this->curl_bin) { exec("$this->curl -m 60 -LkI $this->nexus", $header); $header = implode($header, null); } else { $ch = curl_init($this->nexus); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_NOBODY, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // curl_setopt($ch, CURLOPT_TIMEOUT, 2); $header = curl_exec($ch); curl_close($ch); } preg_match ('/DALogin=(.*?),/', $header, $out); if (isset($out[1])) { $slogin = $out[1]; } else { return false; } } else { $slogin = $this->ssh_login; } if ($this->curl_bin) { $header1 = '"Authorization: Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in='.$passport.',pwd='.$password.','.$auth_string.'"'; exec($this->curl." -m 60 -LkI -H ".$header1."https://".$this->slogin, $auth_string); $header = null; foreach ($auth_string as $key => $value) { if (strstr($value, 'Unauthorized')) { echo 'Unauthorised'; return false; } elseif (strstr($value, 'Authentication-Info')) { $header = $value; } } } else { $ch = curl_init('https://'.$slogin); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Authorization: Passport1.4 OrgVerb=GET,OrgURL=http%3A%2F%2Fmessenger%2Emsn%2Ecom,sign-in='.$this->passport.',pwd='.$this->password.','.$auth_string, 'Host: login.passport.com' )); curl_setopt($ch, CURLOPT_HEADER, 1); curl_setopt($ch, CURLOPT_NOBODY, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // curl_setopt($ch, CURLOPT_TIMEOUT, 2); $header = curl_exec($ch); curl_close($ch); } preg_match ("/from-PP='(.*?)'/", $header, $out); return (isset($out)) ? $out : false; }[/code] Link to comment https://forums.phpfreaks.com/topic/28045-msn-via-php/#findComment-129457 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.