IMified : Make your very own BOT (YIM-AIM-Gtalk-Jabber)

Do you get invites from unknown IDs who asks you to chat. Especially in Yahoo messenger. You see that whenever you type hi/hello/how are you.. the other side almost immediately replies in a pattern. And most of us can immediately sense that its a BOT at the other side.

So what is a BOT?

Its just short for roBOT, we know what that is. Bots are actually automated scripts to work just like human beings(in our case non human being chatterbox).

Now, I’m gonna write about an easy and fun to do ChatterBox with the favor from and Hasin Hayder. IMified lets you use their API to use with Yahoo or Aol or Gtalk/Jabber id. That means you can make your Yahoo ID or AIM ID or Gmail ID powered with a BOT script. 😀

Hasin Hayder made it simpler for us (noob developers) by writing an easy to use wrapper class for the IMified API funtionality. And he released it under BSD license, so anyone can use that for free for any purposes (can use it anywhere-do whatever u want, derive new class from it without mentioning credit)
My friend Ferdous has implemented the IMified API wrapper class with the lastRSS.php class. Now, I’m here to show an example of using Daily horoscope with your BOT. Isn’t that funny?

You’ll just type Sagittarius and hit enter… and it will tell tell your today’s Zodiac reading of the day. You can implement the idea for million other purposes. So add my bot to your gtalk/jabber account and enjoy!

< ?php
include "class.imified.php";

    echo "Lenin's bot to demonstrate the imified API - please add this bot from your gtalk/jabber client. Visit my personal blog at <a href=''>";
$im = new ImifiedHelper("7FF693E6-B7EC-58F9-E621A3960144C21B","USERNAME","ahem!PASSWORDHERE!ahem");
function callback($message, $step, $network, $userKey)
    global $im;
if("Leo"==$message ||"Aries"==$message || "Virgo"==$message || "Libra"==$message ||"Scorpio"==$message ||"Sagittarius"==$message ||	"Capricorn"==$message ||"Pisces"==$message ||"Aquarius"==$message ||"Taurus"==$message ||"Gemini"==$message ||"Cancer"==$message ){
            include "lastRSS.php";
            // Create lastRSS object
            $rss = new lastRSS;
            // Set cache dir(chmod-ed 0777) and cache time limit (1200 seconds)
            $rss->cache_dir = './temp';
            $rss->cache_time = 1200;
            $rss->cp = 'UTF-8';
            $rss->date_format = 'l';
            // Try to load and parse RSS file of
            $rssurl = ''.$message;
            $rs = $rss->get($rssurl);
            if ($rs) {
                echo "Zodiac reading for today Dear ".$message."<br />";
                echo $rs['items'][0]['title']."<br />";
                echo $description = strip_tags(htmlspecialchars_decode($rs['items'][0]['description']))."<br />";
            else {
                echo "Error: It's not possible to get $rssurl...";
        echo "Please type \"help\" to see available commands..<br />";

Acknowledgements :, Hasin Hayder