xmpphp XMPP,从 php 脚本发送消息
你好 我有一个 jabberserver,我希望能够从 php 脚本向用户推送消息。
如果我从浏览器调用 script.php,它会向用户发送一条消息。 我已经尝试过 jaxl 和 xmpphp 这两个 xmp 框架,但我无法让它工作。我自己的服务器没有,Facebook 的服务器也没有。
我的 script.php 有以下内容:
error_reporting(E_ALL);
include("lib/xmpphp/XMPPHP.php");
$conn = new XMPP('chat.facebook.dk', 5222, 'username', 'password', '', 'chat.facebook.com', true, XMPPHP_Log::LEVEL_VERBOSE);
$conn->connect();
$conn->processUntil('session_start');
$conn->message('[email protected]', 'This is a test message!');
$conn->disconnect();
但没有发生任何事情,也没有错误。 我按照本指南设置了一个 echobot,它适用于我的服务器和 Facebook。脚本在这里: http://abhinavsingh.com/blog/2010/02/writing-your-first-facebook-chat-bot-in-php-using-jaxl-library/ <-- 在服务器命令行上运行,等待消息,然后回复。
我必须做什么?
Hi
I have a jabberserver and i would like to be able to push messages out to users from a php script.
F.x. if i call script.php from my browser, it sends a message to a user.
I've tried both with jaxl and xmpphp which are xmp frameworks, but i cant get it to work. Not with my own server, and neither with facebooks server.
I have the following ind my script.php:
error_reporting(E_ALL);
include("lib/xmpphp/XMPPHP.php");
$conn = new XMPP('chat.facebook.dk', 5222, 'username', 'password', '', 'chat.facebook.com', true, XMPPHP_Log::LEVEL_VERBOSE);
$conn->connect();
$conn->processUntil('session_start');
$conn->message('[email protected]', 'This is a test message!');
$conn->disconnect();
But nothing happends and no errors either.
I've followed this guide to set up an echobot, and it works with both my server and facebook. The script is here: http://abhinavsingh.com/blog/2010/02/writing-your-first-facebook-chat-bot-in-php-using-jaxl-library/ <-- and is run on the server commandline, and waiting for a message, and then replys.
What do i have to do ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)