My favorites | Sign in
Project Home Downloads Wiki Issues Source
Search
for
msnbot  
Let msn.class.php work as bot
Updated Feb 4, 2010 by wu.to...@gmail.com

Introduction

Let msn.class.php always online, work as a bot.

Details

  • Create some folder like:
  • 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.
  • The '.msn' file format:
  • TO: someone@hotmail,somone@yahoo.com@32
    Your message here
    2nd line
    
    end here
Comment by 19850304...@gmail.com, May 10, 2008

sd

Comment by curu...@gmail.com, Nov 25, 2008

hi our server (dreamhost) is not support pnctl (fork and signal) i need this code.. what can i do? can u help us

Comment by mporc...@gmail.com, Mar 8, 2009
is it possible to operate two instances of the bot in the same linux?
Comment by jiajiao1...@gmail.com, Apr 26, 2009

how can I logout?

Comment by leonel...@gmail.com, Aug 10, 2009

is it possible to use msnbot trough the browser? I mean, I don't have SSH access to the server...

Comment by boolebo...@gmail.com, Oct 19, 2009

why do i get: Starting MSN bot: msnbotExtension '/var/spool/msnbot/msnbot.php' not present.

Comment by marc19...@gmail.com, Oct 19, 2009

Hi, i would like to know if it was possible to stream .avi as a webcam thanks to the bot ?? :p

Comment by videosex...@gmail.com, Jan 22, 2010

Dois this class still works ?

Comment by macauc...@gmail.com, Apr 12, 2010

I also get this message: Starting MSN bot: msnbotExtension '/var/spool/msnbot/msnbot.php' not present.

anybody tell me how to do?

Comment by turkmedi...@gmail.com, Jun 15, 2010

This class working very good. Also if you make some code modify you can operate 2 (or more) in same time...

Comment by seared2...@gmail.com, Jul 12, 2010

to:macaucits you can use /usr/local/php/bin/php -f /var/spool/msnbot/msnbot.php i use this command is ok!

Comment by seared2...@gmail.com, Jul 13, 2010

我用如下方式,仍然不能用,不知 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)) {

echo "Error for connect to MSN network\n"; echo "$msn->error\n"; exit;
}

$msn->sendMessage($sMsg, $aTo); if ($msn->error != '')

echo "Error: $msn->error\n";

最后给的提示是: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) {

echo "Can't write to $fname\n"; exit;
}

fputs($fp, "TO: $sTo\n$sMsg"); fclose($fp);

这个根本没有使用MSN?我这样分析对吗?

Comment by tinhyeum...@gmail.com, Dec 17, 2011

MSN very good! ( http://tinhyeumangtheo.tk )

Comment by mangketn...@gmail.com, Apr 30, 2012

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 …


Sign in to add a comment
Powered by Google Project Hosting