My favorites | Sign in
Project Logo
                
Search
for
Updated Apr 06, 2007 by wu.tommy
msnbot  
Let msn.class.php work as bot

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 19850304udb, May 10, 2008

sd

Comment by curunai, 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 mporcile, Mar 08, 2009
is it possible to operate two instances of the bot in the same linux?
Comment by jiajiao1010, Apr 26, 2009

how can I logout?

Comment by leonel.sr, 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 booleboole, Oct 19, 2009

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

Comment by marc19894, Oct 19, 2009

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


Sign in to add a comment
Hosted by Google Code