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


imified
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 IMified.com 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 zodiac@bot.im to your gtalk/jabber account and enjoy!

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

if(!isset($_REQUEST&#91;'msg'&#93;))
{
    echo "Lenin's bot zodiac@bot.im to demonstrate the imified API - please add this bot from your gtalk/jabber client. Visit my personal blog at <a href='https://lenin9l.wordpress.com'>Wordpress.com";
    die();
}
//initiate
$im = new ImifiedHelper("7FF693E6-B7EC-58F9-E621A3960144C21B","USERNAME","ahem!PASSWORDHERE!ahem");
//callback
$im->setCallback("callback");
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 ){
            //start
            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 Slashdot.org
            $rssurl = 'http://www.astrocenter.com/us/Feeds/RSS/getDaily.aspx?sign='.$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...";
            }
        //end
        $im->resetStep();
    }
    else{
        echo "Please type \"help\" to see available commands..<br />";
        $im->resetStep();
    }
}
?>

Acknowledgements : IMified.com, Hasin Hayder

Advertisements

Google’s April Fool




Believe
it or not Google made u an April Fool 🙂

See also this 😀

Google TiSP – Google’s April Fool’s Joke
Stands for Toilet Internet Service Provider, Google TiSP is a clever April Fool’s joke by google. It is a FREE in-home wireless broadband service with a witty tagline – Want WiFi around? Just flush it down.

Not Found
The requested URL was not found on this server. There are so many reasons that this might have happened we can scarcely bring ourselves to type them all out. You might have typed the URL incorrectly, for instance. Or (less likely but certainly plausible) we might have coded the URL incorrectly. Or (far less plausible, but theoretically possible, depending on which ill-defined Grand Unifying Theory of physics one subscribes to), some random fluctuation in the space-time continuum might have produced a shatteringly brief but nonetheless real electromagnetic discombobulation which caused this error page to appear. Or (and truth be told, this is by far the most likely scenario) you might have reached a page that we meant to create but didn’t get around to it, since this year’s April Fool’s joke got hacked together at the last minute, more or less the same way this one did. And this one. And this one, and this one, and this one