How to write your own favorite Google Bot ?

Friday, July 24, 2009 Posted by Aman Jain

Here I will show you how to write an IM Bot which will work on gtalk , yahoo, msn, aim and other messengers .

You will just require a web space on your web server to host you Bot.

Here I have created a dummy IM bot which will return "Hi what's your name?" and will ask such simple queries when anyone chats chat with your automatic and smart IM Bot .To get a feel of it add crossaffairs@bot.im to your Gtalk buddy list and chat with it(which we will just learn how to make).


To write such personal bot follow these steps:

1) Go to www.imified.com

2) Register your account there and login using your username and password.

3) Go to developers section and press on " Create a new Bot" Button.

4) Enter the Bot Name and the Bot address you wish to make.I chose here crossaffairs@bot.im.

5) Leave the Bot URL space blank for now and click on "create new bot" button.

6) Save the following code in notepad as sample.php

switch ($_REQUEST['step']) {
case 1:
echo "Hi, what's your name?";
break;
case 2:
echo "Hi " . $_REQUEST['value1'] . ", where do you live?";
break;
case 3:
echo "Well, welcome to this hello world bot, " . $_REQUEST['value1'] . "
from " . $_REQUEST['value2'] . ".";
break;
}

?>



7) Upload the sample.php file to your webserver using FTP tool and make a note of the path of the file . for eg www.crossaffairs.com/sample.php in my case

8) Paste the url of the path to the bot url field on www.imified.com in developer section and click "save".

9) Now you can add the bot you created to the buddy list of GTalk and start chatting with it. (crossaffairs@bot.im in my case).

10) Voila you have created you own personal "bot" and you could use different codes for functioning your bot in the way you want.


StumbleUpon