Create your IM bot for gtalk/jabber/aim/yahoo with imified API

Posted on: December 30, 2008

Recently I made a news bot named AKA with the help of a wrapper class wrote by Hasin Hayder. This cool API has been provided by imified recently to make your application IM enable easily . You may test my bot by sending any instant message to or sending a message from your GTalk. It will grab one of the latest 25 top news from or RSS feed. I have set caching time as 1200 so that it can be easily work with very less bandwidth. I used lastRSS class to grab the RSS feed as I am having some freight to use Google feed parser with JSON 😦

You can make one just for FREE from All you need is to DOWNLOAD the wrapper class to do it quick. Alternatively you may read the quick and dirty documentation from HERE.

Now lemme reveal the source code I used for my news bot :p

// include lastRSS
include "lastRSS.php";
include "class.imified.php";
// Set cache dir and cache time limit (1200 seconds)
// (don't forget to chmod cahce dir to 777 to allow writing)
$rss->cache_dir = './temp';
$rss->cache_time = 1200;
$rss->cp = 'UTF-8';
$rss->date_format = 'l';
//initiating bot...
//@param pass your imified user credentials
    echo "This is a newsbot. You may add it as or";

function callback($message, $step, $network, $userKey)
    global $im;
    $message = strtolower($message);
    if("inews" == $message){
        // Create lastRSS object
        $rss = new lastRSS;
        // Try to load and parse RSS file of
        $rssurl = '';
        $rs = $rss->get($rssurl);
        if ($rs) {
            $i = rand(0,25);
            echo $title = strip_tags(htmlspecialchars_decode($rs['items'][$i]['title']."

            echo $description = strip_tags(htmlspecialchars_decode($rs['items'][$i]['description']))."
        else {
            echo "Error: It's not possible to get $rssurl...";
    elseif("bdnews" == $message){
        // Create lastRSS object
        $rss = new lastRSS;
        $rssurl = '';
        $rs = $rss->get($rssurl);
        if ($rs) {
            $i = rand(0,25);
            echo $title = strip_tags(htmlspecialchars_decode($rs['items'][$i]['title']))."
            echo $description = strip_tags(htmlspecialchars_decode($rs['items'][$i]['description']))."
        else {
            echo "Oops! Looks like Server is Busy! to get ".$rssurl." Give it a try with inews";
        echo "Please type help to see available commands";

Thanks to hasin bro for your cool wrapper class 🙂

Tags: , ,

35 Responses to "Create your IM bot for gtalk/jabber/aim/yahoo with imified API"

i must agree that the bot is very useful! – it’s giving me great news without browser

great work ferdous, carry on 🙂

Keep it up man…:)

Thank you all for visiting my blog. I would like to add one more feature of this API. you may use your bot to post on your blog. Things like microblogging 😉

@lenin xmpphp is a very cool and matured project 🙂

Good job ferdous bhai. I am gonna learning it from you !

Thanks Hasin bhai and you too.

hmm. its great!!.
API gives us to make interesting app.
thanks Hasin boss to create a wonderful api, also thanks to ferdous vi to implement it,
keep it up 🙂

[…] friend Ferdous has implemented the IMified API wrapper class with the lastRSS.php class. Now, I’m here to […]

С Новым Годом! Успехов во всех делах в этом году

Поздравляю автора блога и читателей С Рождеством!

spasibo vchera kak raz dumal nad dannoj temoj.

Прелестно =)

Автор, давай иШШО пиши! Очень твои посты нравятся!

Спасибо за полезную информацию!

Спасибо за статью, всегда рад почитать вас!

Умные стремятся владеть информацией, мудрые – результатом ее обработки…

Не видишь, написано русским по белому?…

Встречают по одежке, а провожают шибко грамотных…

Что у программистов быстрее всего изнашивается? – Отпечатки пальцев.)

Скромность украшает человека. Особенно когда других нет украшений.

Очень интересно! Спасибо.

Так и есть =)

суперский блог!

позитивная статья:)

хорошая статья

[…] friend Ferdous also has an example of a NEWS bot. In this example not much of the capability of the bot is shown to learn more about the IM bot read […]

Интересный материал, спасибо!

Достаточно интересная и познавательная тема

обновляйтеь чаще!

Где аргументы?

А что Вы скажете, если я возьму на себя смелость предположить, что все Ваши сообщения, не более чем выдумка?

Автору спасибо, продолжайте нас радовать!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

I am Nurul Ferdous a Zend Certified Engineer (ZCE), serving at Bangladesh Internet Press Limited (BIPL) as programmer. I am a FOSS advocate and love RnD.


Me @ LinkedIn

View Nurul Ferdous's profile on LinkedIn

My Photos @ Flickr

Blog Stats

  • 43,024 [ Vistors ]

My Twitter Updates

%d bloggers like this: