If you like to write a personal IM bot, just follow these simple steps:
- Open this site and request an invite. You should also give your bot a decent name because you can have just one bot per email address.
http://www.imified.com/developers/index.cfm?sec=invite- An email with a secret key should arrive in your Inbox the next minute. Copy that key to the clipboard and go here to redeem that key.
http://www.imified.com/developers/index.cfm- Now it’s time to create a bot which is actually a simple script that resides on your public web server. It could be in PHP, Perl, Python or any other language.
This is the source of the PHP script for the labnol IM bot it reads your message, gets the relevant data from Google Suggest and echoes it back to the IM window.
// Get all the related keywords from Google Suggest
$u = "http://google.com/complete/search?output=toolbar";
$u = $u . "&q=" . $_REQUEST['msg'];
// Using the curl library since dreamhost doesn't allow fopen
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $u);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$xml = simplexml_load_string(curl_exec($ch));
curl_close($ch);
// Parse the keywords and echo them out to the IM window
$result = $xml->xpath('//@data');
while (list($key, $value) = each($result)) {
echo $value ."
";
}
?>- Once your script is ready, put it somewhere on your web server and copy the full URL to the clipboard.
- Now login to your imified account, paste the script URL and add that im bot to your friends list. This was a very basic bot but the possibilities are endless.