Introduction
Let msn.class.php always online, work as a bot.
Details
mkdir /var/spool/msnbot
mkdir /var/spool/msnbot/log
mkdir /var/spool/msnbot/spool
mkdir /var/spool/msnbot/backup
- Change the attribute for spool folder:
chmod 777 /var/spool/msnbot/spool
chmod o+t /var/spool/msnbot/spool
- put msnbot.php, msn.class.php, config.php to /var/spool/msnbot/, then make msnbot.php executable:
chmod +x /var/spool/msnbot/msnbot.php
- update your account in config.php
// your MSN login account
$msn_acct = 'YOUR_MSN_ACCOUNT';
// your MSN password
$msn_password = 'YOUR_MSN_PASSWORD';
// your alias name for MSN
$msn_alias = 'YOUR_MSN_ALIAS';
// notify list when someone add us to their list or remove us from their list
// after domain, you can assign @n to specify the network of this email,
// where @1 is for MSN (yes, if no @1, also for MSN)
// @32 is for Yahoo
$aNotifyUser = array('MSN_ACCOUNT1@1',
'MSN_ACCOUNT2',
'YAHOO_ACCOUNT@32');- Write your customize function as processMsg(), addContact, removeContact() in msnbot.php
- Use msnbot.sh as your startup script to execute msnbot after system startup.
#! /bin/sh
#
# MSN bot
#
NAME=msnbot
DESC="MSN bot"
set -e
case "$1" in
start)
echo -n "Starting $DESC: $NAME"
/var/spool/msnbot/msnbot.php
echo "."
;;
stop)
echo -n "Stopping $DESC: $NAME"
MSNPID=`cat /var/spool/msnbot/log/msnbot.pid`
kill $MSNPID
echo "."
;;
restart|force-reload)
$0 stop
sleep 1s
$0 start
;;
*)
N=/etc/init.d/$NAME
echo "Usage: $N {start|stop|restart|force-reload}" >&2
exit 1
;;
esac
exit 0- When you need to send message to someone, you can create a text file in /var/spool/msnbot/spool, filename end with '.msn', then change the attribute to 0666.
TO: someone@hotmail,somone@yahoo.com@32
Your message here
2nd line
end here
sd
hi our server (dreamhost) is not support pnctl (fork and signal) i need this code.. what can i do? can u help us
how can I logout?
is it possible to use msnbot trough the browser? I mean, I don't have SSH access to the server...
why do i get: Starting MSN bot: msnbotExtension '/var/spool/msnbot/msnbot.php' not present.
Hi, i would like to know if it was possible to stream .avi as a webcam thanks to the bot ?? :p
Dois this class still works ?
I also get this message: Starting MSN bot: msnbotExtension '/var/spool/msnbot/msnbot.php' not present.
anybody tell me how to do?
This class working very good. Also if you make some code modify you can operate 2 (or more) in same time...
to:macaucits you can use /usr/local/php/bin/php -f /var/spool/msnbot/msnbot.php i use this command is ok!
我用如下方式,仍然不能用,不知 MSN 是否可用
$aTo = explode(',', $argv1?); $sMsg = $argv2?;
$msn_acct = 'me@hotmail.com'; $msn_password = '111111';
include_once('msn.class.php');
$msn = new MSN();
if (!$msn->connect($msn_acct, $msn_password)) {
}$msn->sendMessage($sMsg, $aTo); if ($msn->error != '')
最后给的提示是:echo "Error for connect to MSN network\n";
但是在命令行模式下 运行 /usr/local/php/bin/php msnsendmsg.php me@live.cn "how nice to see you"
就可以正常发送信息,我看了一下源码如下: $fname = '/var/spool/msnbot/spool/msn'.posix_getpid().''.md5(strftime('%D %T')).'.msn';
$fp = fopen($fname, 'wt'); if (!$fp) {
}fputs($fp, "TO: $sTo\n$sMsg"); fclose($fp);
这个根本没有使用MSN?我这样分析对吗?
MSN very good! ( http://tinhyeumangtheo.tk )
http://changtraithang12.tk
http://mangketnoi.tk - Kết nối - Hẹn hò kết bạn - Dating - Tìm bạn bốn phương - Tìm bạn đời. Giúp các bạn tìm bạn bè, tìm bạn trai bạn gái …