<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Abhi&#039;s Weblog &#187; Gtalkbots</title>
	<atom:link href="http://abhinavsingh.com/blog/tag/gtalkbots/feed/" rel="self" type="application/rss+xml" />
	<link>http://abhinavsingh.com/blog</link>
	<description>PHP, Memcached, XMPP and Web Development</description>
	<lastBuildDate>Mon, 27 Feb 2012 09:12:57 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Get lyrics for any song using XMPP and PHP right into your IM &#8211; Add lyricsfly@gtalkbots.com</title>
		<link>http://abhinavsingh.com/blog/2010/01/get-lyrics-for-any-song-using-xmpp-and-php-right-into-your-im-add-lyricsflygtalkbots-com/</link>
		<comments>http://abhinavsingh.com/blog/2010/01/get-lyrics-for-any-song-using-xmpp-and-php-right-into-your-im-add-lyricsflygtalkbots-com/#comments</comments>
		<pubDate>Thu, 07 Jan 2010 17:03:39 +0000</pubDate>
		<dc:creator>Abhinav Singh</dc:creator>
				<category><![CDATA[XMPP]]></category>
		<category><![CDATA[Gtalkbots]]></category>
		<category><![CDATA[JAXL]]></category>
		<category><![CDATA[lyricsfly]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=568</guid>
		<description><![CDATA[XMPP is soon finding it&#8217;s way into real time applications other than just chat. I have combined JAXL (Jabber XMPP client library written in PHP) and the API from lyricsfly.com to build a real time chat bot which can assist you with lyrics for any song. You can start using it by simply adding lyricsfly@gtalkbots.com [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2010%2F01%2Fget-lyrics-for-any-song-using-xmpp-and-php-right-into-your-im-add-lyricsflygtalkbots-com%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2010%2F01%2Fget-lyrics-for-any-song-using-xmpp-and-php-right-into-your-im-add-lyricsflygtalkbots-com%2F&amp;source=imoracle&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f027b5a79a20a49b713f16282f1e0857&amp;hashtags=Gtalkbots,JAXL,lyricsfly,PHP,XMPP&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>XMPP is soon finding it&#8217;s way into real time applications other than just chat. I have combined <a href="http://code.google.com/p/jaxl">JAXL</a> (Jabber XMPP client library written in PHP) and the API from <a href="http://lyricsfly.com">lyricsfly.com</a> to build a real time chat bot which can assist you with lyrics for any song. You can start using it by simply adding lyricsfly@gtalkbots.com to your IM account (e.g. Gtalk, Jabber etc). In this blog post, I will explain in brief the working of lyricsfly bot and how you can integrate XMPP into your own application.</p>
<p><strong style="font-size:18px;"><u>Try out lyricsfly@gtalkbots.com</u></strong><br />
Follow the following steps to get the bot working for you:</p>
<ul>
<li>Login to your gtalk account using any of the IM available</li>
<li>Press Add Contact</li>
<li>Add <code>lyricsfly@gtalkbots.com</code> as your chat buddy</li>
<li>Send a chat message in following format &#8220;Song Title &#8211; Song Artist&#8221; e.g. &#8220;one &#8211; metallica&#8221;</li>
<li>You should see something like this: <img src="http://abhinavsingh.com/blog/wp-content/uploads/2010/01/lyricsfly@gtalkbots.com-Demo-for-one-metallica.png" alt="lyricsfly@gtalkbots.com Demo for &quot;one-metallica&quot;" title="lyricsfly@gtalkbots.com Demo for &quot;one-metallica&quot;" width="550" height="409" class="aligncenter size-full wp-image-569" /></li>
</ul>
<p><strong style="font-size:18px;"><u>Working of lyricsfly@gtalkbots.com with Jaxl</u></strong><br />
Here is in brief the working of lyricsfly bot using Jaxl client library:</p>
<ul>
<li>When someone sends a message like &#8220;one &#8211; metallica&#8221;  to the bot, <code>eventMessage()</code> method is called inside <code>jaxl.class.php</code></li>
<li>eventMessage then extracts the song title and artist name from the message using PHP explode. Filter the title and artist names for allowed characters.</li>
<li>eventMessage also calls lyricsfly API and fetch the lyrics. Finally it sends the lyrics as message to requester.</li>
<li>eventMessage also uses memcached to cache the lyrics. It decreases both response time and load on lyricsfly servers</li>
<li>Bot also keeps a count of number of queries from a particular user. Since it is still under development, currently there is a limit on number of lyrics you can fetch in a single day.</li>
</ul>
<p><strong style="font-size:18px;"><u>Making your own custom bot</u></strong></p>
<ul>
<li>Checkout latest from the trunk
<pre class="php" name="code">sabhinav$ svn checkout http://jaxl.googlecode.com/svn/trunk/ jaxl-read-only</li>
<li>Edit config file with your bot username, password and jabber servers</li>
<li>Run from command like
<pre class="php" name="code">php index.php</pre>
</li>
<li>To customize the bot modify <code>eventMessage</code> and <code>eventPresence</code> methods of Jaxl class inside <code>jaxl.class.php</code></li>
</ul>
<p>For a full fledged running bot example code, edit index.php and include<a href="http://abhinavsingh.com/blog/2009/01/how-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom/"> jaxl4dzone.class.php</a> instead of jaxl.class.php and re-run the bot.</p>
<p>Have fun and enjoy singing songs along with the lyrics.</p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2010%2F01%2Fget-lyrics-for-any-song-using-xmpp-and-php-right-into-your-im-add-lyricsflygtalkbots-com%2F","http:\/\/code.google.com\/p\/jaxl","http:\/\/lyricsfly.com"];var wordpress_toolbar_url = "http://abhinavsingh.com/blog/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZy8yMDEwLzAxL2dldC1seXJpY3MtZm9yLWFueS1zb25nLXVzaW5nLXhtcHAtYW5kLXBocC1yaWdodC1pbnRvLXlvdXItaW0tYWRkLWx5cmljc2ZseWd0YWxrYm90cy1jb20vPHdwdGI%2BR2V0IGx5cmljcyBmb3IgYW55IHNvbmcgdXNpbmcgWE1QUCBhbmQgUEhQIHJpZ2h0IGludG8geW91ciBJTSAmIzgyMTE7IEFkZCBseXJpY3NmbHlAZ3RhbGtib3RzLmNvbTx3cHRiPmh0dHA6Ly9hYmhpbmF2c2luZ2guY29tL2Jsb2c8d3B0Yj5BYmhpJiMwMzk7cyBXZWJsb2c%3D";</script><ul class="related_post"><li><a href="http://abhinavsingh.com/blog/2009/01/introducing-jaxl-open-source-jabber-xmpp-library/" title="Introducing JAXL &#8211; Open Source Jabber XMPP Library">Introducing JAXL &#8211; Open Source Jabber XMPP Library</a> (93)</li><li><a href="http://abhinavsingh.com/blog/2010/08/php-code-setup-and-demo-of-jaxl-boshchat-application/" title="PHP Code, Setup and Demo of Jaxl boshchat application">PHP Code, Setup and Demo of Jaxl boshchat application</a> (80)</li><li><a href="http://abhinavsingh.com/blog/2010/08/releasing-jaxl-2-0-object-oriented-xmpp-framework-in-php/" title="Releasing Jaxl 2.0 &#8211; Object oriented XMPP framework in PHP">Releasing Jaxl 2.0 &#8211; Object oriented XMPP framework in PHP</a> (6)</li><li><a href="http://abhinavsingh.com/blog/2010/01/get-real-time-system-server-load-notification-on-any-im-using-php-and-xmpp/" title="Get real time system &amp; server load notification on any IM using PHP and XMPP">Get real time system &amp; server load notification on any IM using PHP and XMPP</a> (20)</li><li><a href="http://abhinavsingh.com/blog/2011/04/jaxl-library-list-of-available-hooks-for-various-xmpp-events/" title="JAXL library &#8211; List of available hooks for various XMPP events">JAXL library &#8211; List of available hooks for various XMPP events</a> (4)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://abhinavsingh.com/blog/2010/01/get-lyrics-for-any-song-using-xmpp-and-php-right-into-your-im-add-lyricsflygtalkbots-com/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>How to broadcast a message to your Gtalk friends using JAXL?</title>
		<link>http://abhinavsingh.com/blog/2009/05/how-to-broadcast-a-message-to-your-gtalk-friends-using-jaxl/</link>
		<comments>http://abhinavsingh.com/blog/2009/05/how-to-broadcast-a-message-to-your-gtalk-friends-using-jaxl/#comments</comments>
		<pubDate>Wed, 20 May 2009 12:31:44 +0000</pubDate>
		<dc:creator>Abhinav Singh</dc:creator>
				<category><![CDATA[XMPP]]></category>
		<category><![CDATA[Gmail]]></category>
		<category><![CDATA[Gtalk]]></category>
		<category><![CDATA[Gtalkbots]]></category>
		<category><![CDATA[JAXL]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=395</guid>
		<description><![CDATA[In this era of social media we all look forward to easy and utility tools to easily market our site and blogs. In this post I will demonstrate a ready to use script, which will help you broadcast your message to everyone on your gtalk friend list in one go. jaxl4broadcast.class.php jaxl4broadcast.class.php is an extension [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2009%2F05%2Fhow-to-broadcast-a-message-to-your-gtalk-friends-using-jaxl%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2009%2F05%2Fhow-to-broadcast-a-message-to-your-gtalk-friends-using-jaxl%2F&amp;source=imoracle&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f027b5a79a20a49b713f16282f1e0857&amp;hashtags=Gmail,Gtalk,Gtalkbots,JAXL,Open+Source&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>In this era of social media we all look forward to easy and utility tools to easily market our site and blogs. In this post I will demonstrate a ready to use script, which will help you broadcast your message to everyone on your gtalk friend list in one go.</p>
<p><strong style="font-size:16px;"><u>jaxl4broadcast.class.php</u></strong><br />
jaxl4broadcast.class.php is an extension of <a href="http://abhinavsingh.com/blog/2009/01/introducing-jaxl-open-source-jabber-xmpp-library/ target="_blank"">JAXL library</a>. This extension simply saves all your buddy list in an array while connecting with Gtalk servers, and then send out your custom message to all of them in one go. The code that will do the task:</p>
<pre class="php" name="code">
    function setStatus() {
      $this->sendStatus($this->status);
      print "Setting Status...\n";
      print "Done\n";

      foreach($this->rosterList as $buddy) {
        print "Sending message to ".$buddy."\n";
        $this->sendMessage($buddy,"Message broadcasted using *JAXL Library http://code.google.com/p/jaxl*");
        sleep(1);
      }

      /* Now loggout of the system */
      exit;
    }</pre>
<p><strong style="color:#FF0000">PS: You need to checkout the latest version of xmpp.class.php for jaxl4broadcast.class.php to work. jaxl-1.0.4 doesn&#8217;t include the latest checked in xmpp.class.php</strong></p>
<p><strong style="font-size:16px;"><u>Using jaxl4broadcast.class.php</u></strong></p>
<ul>
<li>Checkout the latest version of JAXL library from <a href="http://code.google.com/p/jaxl/source/checkout">here</a></li>
<li>Open <em>config.ini.php</em>, replace <strong>myproductionuser</strong> => <strong>gmail id</strong> and <strong>password</strong> => <strong>gmail password</strong></li>
<li>Open <em>index.php</em>, replace <strong>jaxl.class.php</strong> => <strong>jaxl4broadcast.class.php</strong></li>
<li>Open command line window (for windows) and shell prompt (for *nix). Navigate to the checked out directory</li>
<li>From command prompt run <strong>php index.php</strong></li>
<li>If everything goes alright, you will see something like the image below</li>
<li>See list of <a href="http://code.google.com/p/jaxl/">known issues</a> if you are new to JAXL and having trouble</li>
</ul>
<p><img src="http://abhinavsingh.com/blog/wp-content/uploads/2009/05/jaxl4broadcast.gif" alt="jaxl4broadcast" title="jaxl4broadcast" width="665" height="335" class="alignleft size-full wp-image-404" /></p>
<p>Other JAXL Extensions you may want to checkout:</p>
<ul>
<li>dzone@gtalkbots.com (<a href="http://code.google.com/p/jaxl/source/browse/trunk/jaxl4gmail.class.php">Source Code</a>)</li>
<li>Sending custom out-of-office mails in Gmail (<a href="http://code.google.com/p/jaxl/source/browse/trunk/jaxl4dzone.class.php">Source Code</a>)</li>
</ul>
<p>Happy Broadcasting!</p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2009%2F05%2Fhow-to-broadcast-a-message-to-your-gtalk-friends-using-jaxl%2F","http:\/\/code.google.com\/p\/jaxl\/source\/checkout","http:\/\/code.google.com\/p\/jaxl\/","http:\/\/code.google.com\/p\/jaxl\/source\/browse\/trunk\/jaxl4gmail.class.php","http:\/\/code.google.com\/p\/jaxl\/source\/browse\/trunk\/jaxl4dzone.class.php"];var wordpress_toolbar_url = "http://abhinavsingh.com/blog/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZy8yMDA5LzA1L2hvdy10by1icm9hZGNhc3QtYS1tZXNzYWdlLXRvLXlvdXItZ3RhbGstZnJpZW5kcy11c2luZy1qYXhsLzx3cHRiPkhvdyB0byBicm9hZGNhc3QgYSBtZXNzYWdlIHRvIHlvdXIgR3RhbGsgZnJpZW5kcyB1c2luZyBKQVhMPzx3cHRiPmh0dHA6Ly9hYmhpbmF2c2luZ2guY29tL2Jsb2c8d3B0Yj5BYmhpJiMwMzk7cyBXZWJsb2c%3D";</script><ul class="related_post"><li><a href="http://abhinavsingh.com/blog/2009/02/programatically-control-your-google-mails-using-jaxl-v-104/" title="Programatically control your google mails using JAXL v 1.0.4">Programatically control your google mails using JAXL v 1.0.4</a> (5)</li><li><a href="http://abhinavsingh.com/blog/2009/01/how-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom/" title="How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com">How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com</a> (8)</li><li><a href="http://abhinavsingh.com/blog/2009/01/introducing-jaxl-open-source-jabber-xmpp-library/" title="Introducing JAXL &#8211; Open Source Jabber XMPP Library">Introducing JAXL &#8211; Open Source Jabber XMPP Library</a> (93)</li><li><a href="http://abhinavsingh.com/blog/2010/08/releasing-jaxl-2-0-object-oriented-xmpp-framework-in-php/" title="Releasing Jaxl 2.0 &#8211; Object oriented XMPP framework in PHP">Releasing Jaxl 2.0 &#8211; Object oriented XMPP framework in PHP</a> (6)</li><li><a href="http://abhinavsingh.com/blog/2010/01/get-lyrics-for-any-song-using-xmpp-and-php-right-into-your-im-add-lyricsflygtalkbots-com/" title="Get lyrics for any song using XMPP and PHP right into your IM &#8211; Add lyricsfly@gtalkbots.com">Get lyrics for any song using XMPP and PHP right into your IM &#8211; Add lyricsfly@gtalkbots.com</a> (17)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://abhinavsingh.com/blog/2009/05/how-to-broadcast-a-message-to-your-gtalk-friends-using-jaxl/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com</title>
		<link>http://abhinavsingh.com/blog/2009/01/how-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom/</link>
		<comments>http://abhinavsingh.com/blog/2009/01/how-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 09:54:08 +0000</pubDate>
		<dc:creator>Abhinav Singh</dc:creator>
				<category><![CDATA[XMPP]]></category>
		<category><![CDATA[Dzone]]></category>
		<category><![CDATA[Gtalk]]></category>
		<category><![CDATA[Gtalkbots]]></category>
		<category><![CDATA[JAXL]]></category>
		<category><![CDATA[Open Source]]></category>

		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=72</guid>
		<description><![CDATA[The most funny part of knowing XMPP protocol is that you can execute all your daily web needs using it. Be it playing anagram online or achieving your status messages. And your life gets easy if you are using an XMPP Client Library like JAXL. Here I have tried to create a simple bot which [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2009%2F01%2Fhow-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2009%2F01%2Fhow-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom%2F&amp;source=imoracle&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f027b5a79a20a49b713f16282f1e0857&amp;hashtags=Dzone,Gtalk,Gtalkbots,JAXL,Open+Source&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>The most funny part of knowing XMPP protocol is that you can execute all your daily web needs using it. Be it <a href="http://abhinavsingh.com/blog/2008/11/gamesgtalkbotscom-online-gaming-enabled-on-gtalk/" target="_blank">playing anagram online</a> or <a href="http://abhinavsingh.com/blog/2008/09/save-your-and-your-friends-status-messages-share-and-promote-your-website-through-your-status/" target="_blank">achieving your status messages</a>. And your life gets easy if you are using an XMPP Client Library like <a href="http://code.google.com/p/jaxl" target="_blank">JAXL</a>.</p>
<p>Here I have tried to create a simple bot which allows you to read newest links posted on dzone category wise. Simply add <a href="mailto:dzone@gtalkbots.com">dzone@gtalkbots.com</a> in your gtalk messenger and start by typing <strong>options</strong>.</p>
<p>Available options are:</p>
<ul>
<li><strong>frontpage:</strong> Will send you latest links on frontpage.</li>
<li><strong>queue:</strong> Will send you latest links in queue.</li>
<li><strong>tag:</strong> Send in a tag e.g. php,java,xml and you will get latest links for the particular tag</li>
</ul>
<p>Here is modified eventMessage() method of JAXL library powering <a href="mailto:dzone@gtalkbots.com">dzone@gtalkbots.com</a>:</p>
<pre class="php" name="code">    function eventMessage($fromJid, $content, $offline = FALSE) {

      // If the message is not an offliner
      if(!$offline) {
        if($this->restrictJid &#038;&#038; !in_array($this->getBareJid($fromJid),$this->authorizedJid)) { // Block un-authorized users
          $this->logger->logger($fromJid." tried using this service by sending:\n".$content);
          $message = 'You are not authorized to use this service';
          $this->sendMessage($fromJid,$message);
          return TRUE;
        }
        else {
          $content = strtolower(trim($content));

          // Build RSS Feed URL depending upon passed IM
          if($content == "options") {
            $message = "Available options are:\n";
            $message .= "*1. frontpage:* Will send you latest links on frontpage.\n";
            $message .= "*2. queue:* Will send you latest links in queue.\n";
            $message .= "*3. tag:* Send in a tag e.g. php,java,xml and you will get latest links for the particular tag\n";
            $this->sendMessage($fromJid,$message);
            return TRUE;
          }
          else if($content == "frontpage") $url = "http://www.dzone.com/links/feed/frontpage/rss.xml";
          else if($content == "queue") $url = "http://www.dzone.com/links/feed/queue/rss.xml";
          else $url = "http://www.dzone.com/links/feed/frontpage/".$content."/rss.xml";

          // Generate cache file location
          $cache_file = "cache/dzone/".md5($url)."-".$content.".rss";

          // If cache file is not older than 900 seconds (15 min)
          if(file_exists($cache_file) &#038;&#038; (filemtime($cache_file) > time() - 900)) {
            $this->logger->logger("RSS already found cached...");
          }
          else { // else fetch a fresh copy of RSS
            $this->logger->logger("Fetching RSS for url:\n".$url);
            $head = $this->fetchWebURL($url);
            if($head['errno'] == 0 &#038;&#038; $head['http_code'] == 200) {
              $this->logger->logger("Fetched successfully...");
              $data = $head['content'];
              $fh = fopen($cache_file,"w");
              fwrite($fh,$data);
              fclose($fh);
            }
            else {
              // Send a message saying no such feed exists
              $this->logger->logger("Failed to fetch the RSS feed...");
              $message = 'No feed exists for the passed keyword: '.$content;
              $this->sendMessage($fromJid,$message);
              return TRUE;
            }
          }

          // Parse RSS Feed
          $r = &#038;new XML_RSS($cache_file);
          $r->parse();
          $NumberOfFeeds = count($r->getItems());
          if($NumberOfFeeds > 0) {
            $message = '';
            foreach($r->getItems() as $key => $item) {
              if($this->count < $this->maxResults) {
                $message .= "*".$item["title"]."*\n";
                $message .= $item["link"]."\n";
                $message .= $item["description"]."\n\n";
                $this->count++;
              }
              else {
                break;
              }
            }
            $message .= "powered by *Jaxl* http://code.google.com/p/jaxl"."\n\n";
            $this->sendMessage($fromJid,$message);
            $this->count = 0;
            return TRUE;
          }
          else {
            // Send a message saying no feed found
            $message = 'No feed was found for passed keyword: '.$content;
            $this->sendMessage($fromJid,$message);
            return TRUE;
          }
        }
      }
      else {
        // Send an appropriate message
        $this->logger->logger($fromJid." sent an offliner saying:\n".$content);
        return TRUE;
      }
    }
</pre>
<p>To run this sample application you need:</p>
<ul>
<li>JAXL Library (<a target="_blank" href="http://code.google.com/p/jaxl">http://code.google.com/p/jaxl</a>)</li>
<li>XML_RSS Package (<em>pear install XML_RSS</em>)</li>
<li>Create a directory cache/dzone where this application will cache all rss files</li>
<li>Include jaxl4dzone.class.php in index.php, instead of jaxl.class.php and run &#8216;php index.php&#8217; from command line to start this application</li>
</ul>
<p>Checkout the complete code and JAXL library from <a href="http://code.google.com/p/jaxl">http://code.google.com/p/jaxl</a>.</p>
<p>Now browse new links even when dzone is down for maintenance <img src='http://abhinavsingh.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /><br />
Do let me know about your feedbacks <img src='http://abhinavsingh.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2009%2F01%2Fhow-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom%2F","http:\/\/code.google.com\/p\/jaxl","mailto:dzone@gtalkbots.com","mailto:dzone@gtalkbots.com","http:\/\/code.google.com\/p\/jaxl","http:\/\/code.google.com\/p\/jaxl"];var wordpress_toolbar_url = "http://abhinavsingh.com/blog/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZy8yMDA5LzAxL2hvdy10by1nZXQtZHpvbmUtZmVlZHMtYXMtaW0tdXNpbmctamF4bC1hZGQtZHpvbmVndGFsa2JvdHNjb20vPHdwdGI%2BSG93IHRvIGdldCBkem9uZSBmZWVkcyBhcyBJTSB1c2luZyBKQVhMPyBBZGQgZHpvbmVAZ3RhbGtib3RzLmNvbTx3cHRiPmh0dHA6Ly9hYmhpbmF2c2luZ2guY29tL2Jsb2c8d3B0Yj5BYmhpJiMwMzk7cyBXZWJsb2c%3D";</script><ul class="related_post"><li><a href="http://abhinavsingh.com/blog/2009/05/how-to-broadcast-a-message-to-your-gtalk-friends-using-jaxl/" title="How to broadcast a message to your Gtalk friends using JAXL?">How to broadcast a message to your Gtalk friends using JAXL?</a> (13)</li><li><a href="http://abhinavsingh.com/blog/2009/01/introducing-jaxl-open-source-jabber-xmpp-library/" title="Introducing JAXL &#8211; Open Source Jabber XMPP Library">Introducing JAXL &#8211; Open Source Jabber XMPP Library</a> (93)</li><li><a href="http://abhinavsingh.com/blog/2009/02/programatically-control-your-google-mails-using-jaxl-v-104/" title="Programatically control your google mails using JAXL v 1.0.4">Programatically control your google mails using JAXL v 1.0.4</a> (5)</li><li><a href="http://abhinavsingh.com/blog/2010/08/releasing-jaxl-2-0-object-oriented-xmpp-framework-in-php/" title="Releasing Jaxl 2.0 &#8211; Object oriented XMPP framework in PHP">Releasing Jaxl 2.0 &#8211; Object oriented XMPP framework in PHP</a> (6)</li><li><a href="http://abhinavsingh.com/blog/2010/01/get-lyrics-for-any-song-using-xmpp-and-php-right-into-your-im-add-lyricsflygtalkbots-com/" title="Get lyrics for any song using XMPP and PHP right into your IM &#8211; Add lyricsfly@gtalkbots.com">Get lyrics for any song using XMPP and PHP right into your IM &#8211; Add lyricsfly@gtalkbots.com</a> (17)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://abhinavsingh.com/blog/2009/01/how-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Introducing JAXL &#8211; Open Source Jabber XMPP Library</title>
		<link>http://abhinavsingh.com/blog/2009/01/introducing-jaxl-open-source-jabber-xmpp-library/</link>
		<comments>http://abhinavsingh.com/blog/2009/01/introducing-jaxl-open-source-jabber-xmpp-library/#comments</comments>
		<pubDate>Fri, 02 Jan 2009 14:08:42 +0000</pubDate>
		<dc:creator>Abhinav Singh</dc:creator>
				<category><![CDATA[Open Source Projects]]></category>
		<category><![CDATA[Gtalk]]></category>
		<category><![CDATA[Gtalkbots]]></category>
		<category><![CDATA[Jabber]]></category>
		<category><![CDATA[JAXL]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[XMPP]]></category>

		<guid isPermaLink="false">http://abhinavsingh.com/blog/?p=70</guid>
		<description><![CDATA[Introduction JAXL stands for &#8220;Jabber XMPP Library&#8220;. For fun, it stands for &#8220;Just Another XMPP Library&#8221; This library currently supports following features: Connect to a Jabber Server (e.g. Gtalk) TLS Encryption DIGEST-MD5 and PLAIN authentication mechanisms Roster Support Library comes with the following class files: config.ini.php : Holds your jabber account and mysql connection information [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2009%2F01%2Fintroducing-jaxl-open-source-jabber-xmpp-library%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2009%2F01%2Fintroducing-jaxl-open-source-jabber-xmpp-library%2F&amp;source=imoracle&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f027b5a79a20a49b713f16282f1e0857&amp;hashtags=Gtalk,Gtalkbots,Jabber,JAXL,Open+Source,PHP,XMPP&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><strong style="font-size:20px;"><span style="text-decoration: underline;">Introduction</span></strong></p>
<p><strong>JAXL</strong> stands for &#8220;<strong>Jabber XMPP Library</strong>&#8220;. For fun, it stands for &#8220;<strong>Just Another XMPP Library</strong>&#8221;</p>
<p>This library currently supports following features:</p>
<ul>
<li>Connect to a Jabber Server (e.g. Gtalk)</li>
<li>TLS Encryption</li>
<li>DIGEST-MD5 and PLAIN authentication mechanisms</li>
<li>Roster Support</li>
</ul>
<p>Library comes with the following class files:</p>
<ol>
<li><strong>config.ini.php</strong> : Holds your jabber account and mysql connection information</li>
<li><strong>mysql.class.php</strong> : Basic MySQL connection class used to insert received messages and presence into MySQL database</li>
<li><strong>logger.class.php</strong> : A very basic logger class which allows you to log all XML stanza&#8217;s send and received from jabber server</li>
<li><strong>xmpp.class.php</strong> : Base XMPP class library which implements the XMPP protocol</li>
<li><strong>jaxl.class.php</strong> : JAXL class which extends XMPP class library. Should be the starting point for your application.</li>
<li><strong>index.php</strong> : After building your application in jaxl.class.php, you finally initializa and call your methods here</li>
</ol>
<p><strong style="font-size:20px;"><span style="text-decoration: underline;">Source Code</span></strong><br />
JAXL is hosted at Google Code. Checkout full source code from here:<br />
<a href="http://code.google.com/p/jaxl" target="_blank">http://code.google.com/p/jaxl</a></p>
<table style="background-color: #fff; padding: 5px;border:1px dotted #999999" cellspacing=0>
<tr>
<td>
  <img src="http://groups.google.com/groups/img/3nb/groups_bar.gif" height=26 width=132 alt="Google Groups">
  </td>
</tr>
<tr>
<td style="padding-left: 5px;font-size: 125%">
  <b>jaxl</b>
  </td>
</tr>
<tr>
<td style="padding-left: 5px">
  <a href="http://groups.google.com/group/jaxl" target="_blank">Visit this group</a>
  </td>
</tr>
</table>
<p><strong style="font-size:20px;"><span style="text-decoration: underline;">How to use JAXL:</span></strong><br />
JAXL Client Library is highly structured. There is a base <em>XMPP class library (xmpp.class.php)</em> and a <em>JAXL class library (jaxl.class.php)</em> which is derived from the base XMPP class library.</p>
<p>Base XMPP class library implements the XMPP protocol and it also provides you with two extendable methods named <em>eventMessage()</em> and <em>eventPresence()</em>. These methods are internally called when a message or presence XML Stanza is received from the Jabber server.</p>
<p>Jaxl.class.php must be the starting point for all your applications. Simply customize the eventMessage() and eventPresence() Method for your application. Other methods which might interest you while customizing them are:</p>
<ol>
<li>sendMessage($jid,$message) : For sending message to a particular Jid</li>
<li>sendStatus() : To set your status message</li>
<li>roster(&#8216;get&#8217;) : To get list of roster</li>
<li>roster(&#8216;add&#8217;,$jid) : Add a new contact in roster list</li>
<li>roster(&#8216;remove&#8217;,$jid) : Remove a contact from roster list</li>
<li>roster(&#8216;update&#8217;,$jid,$name,$groups) : Update a particular contact in roster</li>
<li>subscribe($jid) : Subscribe for presence of a particular $jid</li>
</ol>
<p>This library includes the following files:</p>
<p><strong>Config File (config.ini.php)</strong><br />
You specify all your jabber account username and password in this file. For development environment keep <em>$env = &#8220;devel&#8221;</em> and for production simply change it to <em>$env = &#8220;prod&#8221;</em></p>
<pre class="php" name="code">  // Set an enviornment
  $env = "prod";

  // Log Level for logger class
  $logEnable = TRUE;

  // Log in MySQL database
  $logDB = FALSE;

  $key = array("prod"=>array("user"=>"myproductionuser",
                             "pass"=>"password",
                             "host"=>"talk.google.com",
                             "port"=>5222,
                             "domain"=>"gmail.com"
                            ),
              "devel"=>array("user"=>"mydevelopmentuser",
                             "pass"=>"password",
                             "host"=>"localhost",
                             "port"=>5222,
                             "domain"=>"localhost"
                            )
              );

  $db = array("prod"=>array("dbuser"=>"root",
                            "dbpass"=>"password",
                            "dbhost"=>"localhost",
                            "dbname"=>"jaxl"
                           ),
             "devel"=>array("dbuser"=>"root",
                            "dbpass"=>"password",
                            "dbhost"=>"localhost",
                            "dbname"=>"jaxl"
                           )
             );</pre>
<p><!-- ADSENSE LEFT TEXT AD --><br />
<strong>MySQL Class (mysql.class.php)</strong><br />
This is a basic MySQL connection class used to insert received messages and presence into MySQL database</p>
<p><strong>Base XMPP Class (xmpp.class.php)</strong><br />
You should not worry about this class. Until and unless you are aware of what are you trying to achieve you should not touch this class file.</p>
<p><strong>Logger Class (logger.class.php)</strong><br />
This is a basic logger class. It help you log XML send to and received from jabber server. Might prove helpful in debugging and if you are interested in learning the core of XMPP Protocol.</p>
<p><strong>Extended JAXL Class (jaxl.class.php)</strong><br />
You will be customizing eventMessage() and eventPresence() methods here.</p>
<pre class="php" name="code">    function eventMessage($fromJid, $content, $offline = FALSE) {
      if($offline) {
        $this->sendMessage($fromJid,"Hi, Thanks for your offline message");
      }
      else {
        $this->sendMessage($fromJid,"Hi, Thanks for your message");
      }

      if($this->logDB) {
        // Save the message in the database
        $timestamp = date('Y-m-d H:i:s');
        $query = "INSERT INTO message (FromJid,Message,Timestamp) value ('$fromJid','$content','$timestamp')";
        $this->mysql->setData($query);
      }
    }

    function eventPresence($fromJid, $status, $photo) {
      // Change your status message to your friend's status
      $this->sendStatus($status);

      if($this->logDB) {
        // Save the presence in the database
        $timestamp = date('Y-m-d H:i:s');
        $query = "INSERT INTO presence (FromJid,Status,Timestamp) value ('$fromJid','$status','$timestamp')";
        $this->mysql->setData($query);
      }
    }</pre>
<p>In above example I have done 4 things:</p>
<ul>
<li>Sends back a message saying &#8220;Hi, Thanks for your offline message&#8221;, when I receive a offliner.</li>
<li>Sends back a message saying &#8220;Hi, Thanks for your message&#8221;, when I receive an IM from my friend.</li>
<li>Change my status message, as and when I receive a status update from my friends. </li>
<li>Save messages and presence into database if $logDB = TRUE in config.ini.php</li>
</ul>
<p><strong>Final Call (index.php)</strong></p>
<pre class="php" name="code">  /* Include Key file */
  include_once("config.ini.php");

  /* Include JAXL Class */
  include_once("jaxl.class.php");

  /* Create an instance of XMPP Class */
  $jaxl = new JAXL($key[$env]['host'],    // Jabber Server Hostname
                   $key[$env]['port'],    // Jabber Server Port
                   $key[$env]['user'],    // Jabber User
                   $key[$env]['pass'],    // Jabber Password
                   $key[$env]['domain'],  // Jabber Domain
                   $db[$env]['dbhost'],   // MySQL DB Host
                   $db[$env]['dbname'],   // MySQL DB Name
                   $db[$env]['dbuser'],   // MySQL DB User
                   $db[$env]['dbpass'],   // MySQL DB Pass
                   $logEnable,            // Enable Logging
                   $logDB                 // Enable MySQL Inserts
                  );

  try {
    /* Initiate the connection */
    $jaxl->connect();

    /* Communicate with Jabber Server */
    while($jaxl->isConnected) {
      $jaxl->getXML();
    }
  }
  catch(Exception $e) {
    die($e->getMessage());
  }</pre>
<p><strong style="font-size:20px;"><span style="text-decoration: underline;">Instant Messenger Powered by JAXL</span></strong><br />
I am pleased to announce 3 months after release of JAXL, 1st Instant Messenger powered by JAXL. Currently the instant messenger is in testing phase and will be released after some 3-4 weeks of thorough testing. Meanwhile here is the first clip shot:<br />
<a href="http://tinyurl.com/bpr6ef"><img src="http://jaxl.googlegroups.com/web/jaxl-instant-messenger.PNG?gda=dCrVIUwAAADFEG5r_Q2qBojmAJz06pZRsDTpvF39n0Pii2VnNl-O_NnGpw1kyLV36KvRxqaqXbp4fPh_IXG1gRYJTXFNsae9_Vpvmo5s1aABVJRO3P3wLQ" style="border:0px;padding:3px;"/></a></p>
<p><strong style="font-size:20px;"><span style="text-decoration: underline;">Disclaimer</span></strong><br />
Currently this library is being developed and used at <a href="http://gtalkbots.com" target="_blank">Gtalkbots.com</a> . Though it is thoroughly tested and being used, I still recommend not to use it on production servers. Mainly, since it is heavily customized for Gtalkbot&#8217;s usage. I am releasing it, as I see it of use for the community worldwide. If you want to use it, use at your own risk. Let me know of any changes you make to this library. In future I look to make this library more generic.</p>
<p>Enjoy and let me know of any bugs, feedbacks, enhancements or any abuse you may want to pass through if it doesn&#8217;t work for you <img src='http://abhinavsingh.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p style="color:#FF0000;font-weight:bold;">You should be running index.php using command line and not browser (recommended). This class is currently highly customized for Gtalkbots usage and works perfectly with Gtalk Servers.</p>
<div id="paidTxtLinkAds">Learn php to pass <a href="http://www.testking.org/CISSP.htm">testking CISSP</a> exam using our latest <a href="http://www.testking.org/70-646.htm">testking 70-646</a> video demos and <a href="http://www.testking.org/640-863.htm">testking 640-863</a> tutorials.</div>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2009%2F01%2Fintroducing-jaxl-open-source-jabber-xmpp-library%2F","http:\/\/code.google.com\/p\/jaxl","http:\/\/groups.google.com\/group\/jaxl","http:\/\/tinyurl.com\/bpr6ef","http:\/\/gtalkbots.com","http:\/\/www.testking.org\/CISSP.htm","http:\/\/www.testking.org\/70-646.htm","http:\/\/www.testking.org\/640-863.htm"];var wordpress_toolbar_url = "http://abhinavsingh.com/blog/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZy8yMDA5LzAxL2ludHJvZHVjaW5nLWpheGwtb3Blbi1zb3VyY2UtamFiYmVyLXhtcHAtbGlicmFyeS88d3B0Yj5JbnRyb2R1Y2luZyBKQVhMICYjODIxMTsgT3BlbiBTb3VyY2UgSmFiYmVyIFhNUFAgTGlicmFyeTx3cHRiPmh0dHA6Ly9hYmhpbmF2c2luZ2guY29tL2Jsb2c8d3B0Yj5BYmhpJiMwMzk7cyBXZWJsb2c%3D";</script><ul class="related_post"><li><a href="http://abhinavsingh.com/blog/2010/08/releasing-jaxl-2-0-object-oriented-xmpp-framework-in-php/" title="Releasing Jaxl 2.0 &#8211; Object oriented XMPP framework in PHP">Releasing Jaxl 2.0 &#8211; Object oriented XMPP framework in PHP</a> (6)</li><li><a href="http://abhinavsingh.com/blog/2010/01/get-lyrics-for-any-song-using-xmpp-and-php-right-into-your-im-add-lyricsflygtalkbots-com/" title="Get lyrics for any song using XMPP and PHP right into your IM &#8211; Add lyricsfly@gtalkbots.com">Get lyrics for any song using XMPP and PHP right into your IM &#8211; Add lyricsfly@gtalkbots.com</a> (17)</li><li><a href="http://abhinavsingh.com/blog/2009/05/how-to-broadcast-a-message-to-your-gtalk-friends-using-jaxl/" title="How to broadcast a message to your Gtalk friends using JAXL?">How to broadcast a message to your Gtalk friends using JAXL?</a> (13)</li><li><a href="http://abhinavsingh.com/blog/2009/02/programatically-control-your-google-mails-using-jaxl-v-104/" title="Programatically control your google mails using JAXL v 1.0.4">Programatically control your google mails using JAXL v 1.0.4</a> (5)</li><li><a href="http://abhinavsingh.com/blog/2009/01/how-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom/" title="How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com">How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com</a> (8)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://abhinavsingh.com/blog/2009/01/introducing-jaxl-open-source-jabber-xmpp-library/feed/</wfw:commentRss>
		<slash:comments>93</slash:comments>
		</item>
		<item>
		<title>What happens before you finally viewed this page?</title>
		<link>http://abhinavsingh.com/blog/2008/11/what-happens-before-you-finally-viewed-this-page/</link>
		<comments>http://abhinavsingh.com/blog/2008/11/what-happens-before-you-finally-viewed-this-page/#comments</comments>
		<pubDate>Tue, 25 Nov 2008 14:57:37 +0000</pubDate>
		<dc:creator>Abhinav Singh</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[ARecord]]></category>
		<category><![CDATA[CNAME]]></category>
		<category><![CDATA[DNS]]></category>
		<category><![CDATA[Godaddy]]></category>
		<category><![CDATA[Google Apps]]></category>
		<category><![CDATA[Gtalkbots]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://abhinavsingh.com/blog/2008/11/what-happens-before-you-finally-viewed-this-page/</guid>
		<description><![CDATA[Since past 1 week or so I am trying to make a small tiny light weight web server of my own, and for the same I have been referring to dozens of papers, websites, people and what not. I still haven&#8217;t finished making one, I am still toggling between Java and Python, since both seems [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2008%2F11%2Fwhat-happens-before-you-finally-viewed-this-page%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2008%2F11%2Fwhat-happens-before-you-finally-viewed-this-page%2F&amp;source=imoracle&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f027b5a79a20a49b713f16282f1e0857&amp;hashtags=ARecord,CNAME,DNS,Godaddy,Google+Apps,Gtalkbots,VPS&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Since past 1 week or so I am trying to make a small tiny light weight web server of my own, and for the same I have been referring to dozens of papers, websites, people and what not. I still haven&#8217;t finished making one, I am still toggling between Java and Python, since both seems to satisfy my needs and unfortunately I am master in none. While I was digging deep into the theory of how can I make a web server, I cleared many other concepts of mine, which finally leads to this post.</p>
<p><span style="font-weight: bold;">&#8220;What happens before you finally viewed this page/post of mine ?&#8221;</span> &#8211; Many of you might know behind the scene stories and many like me might have a vague idea. But for the good of all those who don&#8217;t know and for people like me who needs a reference, I thought of better penning it down.</p>
<p>Lets see what possibly is going in the background:</p>
<ol>
<li>Suppose you type in <a href="http://www.yahoo.com">http://www.yahoo.com</a> in your web browser or clicked this link on some other page.</li>
<li>Your browser see&#8217;s the above URL, and identifies it as a HTTP protocol.</li>
<li>Then it breaks the URL into <span style="font-weight: bold;">Protocol, Domain Name, File Name </span>(in above case no file name is specified)</li>
<li>Browser contacts its default <span style="font-weight: bold;">DNS</span> (Domain Name Server), which helps it with an IP Address. DNS is a huge distributed database which contains mapping of URL&#8217;s to IP Address. Your browser&#8217;s default DNS might or might not have the required mapping of URL to IPAddress.</li>
<li>If it don&#8217;t have the IPAddress corresponding to http://www.yahoo.com , it will try to contact other <span style="font-weight: bold;">root name servers</span> for the required IPAddress.</li>
<li>If it already have the IPAddress corresponding to http://www.yahoo.com (which is possible if a similar request has already been made recently) it will provide the required IPAddress to your browser.</li>
</ol>
<p>And finally your browser then connects to the IPAddress it received and servers you the page returned back by Yahoo!. If you are still not clear about the process, following practical example might help you.</p>
<p><img style="border: 1px solid #444444; padding: 5px;" src="http://abhinavsingh.com/library/images/DNS.gif" alt="" /></p>
<ol>
<li>I thought of starting a website and decided to name it as <a href="http://gtalkbots.com">http://gtalkbots.com</a></li>
<li>Firstly, I needed to register domain name with a registrant. For e.g. In my case I blocked the domain name gtalkbots.com with<a href="http://godaddy.com"> godaddy.com</a>.</li>
<li>Secondly, I needed to have a machine i.e. a place where I can have all my HTML, PHP files. So I bought a VPS (Virtual Private Server)</li>
<li>Thirdly, I had to link the above two i.e. when someone types in http://gtalkbots.com in his browser, it should come to my VPS where I have my HTML files.</li>
<li>For linking the domain name and my VPS, I simply make an <span style="font-weight: bold;">ARecord</span> entry at godaddy, telling it the IPAddress of my VPS. In turn when you type in http://gtalkbots.com in your browser, GoDaddy redirects you to my VPS. (Google for ARecord and CNAME for more details)</li>
<li>Last 4 entries in the image above are for linking my gtalkbots.com domain with my <a href="http://google.com/a">google apps</a> account, so that I can send and receive my gtalkbots.com email on google apps.</li>
</ol>
<p>There is a lot more to it, however the info above is more than sufficient to understand the basics of<br />
<span style="font-weight: bold;">&#8220;What happens before you finally viewed this page/post of mine ?&#8221;</span></p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2008%2F11%2Fwhat-happens-before-you-finally-viewed-this-page%2F","http:\/\/www.yahoo.com","http:\/\/gtalkbots.com","http:\/\/godaddy.com","http:\/\/google.com\/a"];var wordpress_toolbar_url = "http://abhinavsingh.com/blog/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZy8yMDA4LzExL3doYXQtaGFwcGVucy1iZWZvcmUteW91LWZpbmFsbHktdmlld2VkLXRoaXMtcGFnZS88d3B0Yj5XaGF0IGhhcHBlbnMgYmVmb3JlIHlvdSBmaW5hbGx5IHZpZXdlZCB0aGlzIHBhZ2U%2FPHdwdGI%2BaHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZzx3cHRiPkFiaGkmIzAzOTtzIFdlYmxvZw%3D%3D";</script><ul class="related_post"><li><a href="http://abhinavsingh.com/blog/2009/01/new-year-new-server-and-a-new-theme/" title="New Year, New Server and a New Theme">New Year, New Server and a New Theme</a> (14)</li><li><a href="http://abhinavsingh.com/blog/2010/01/get-lyrics-for-any-song-using-xmpp-and-php-right-into-your-im-add-lyricsflygtalkbots-com/" title="Get lyrics for any song using XMPP and PHP right into your IM &#8211; Add lyricsfly@gtalkbots.com">Get lyrics for any song using XMPP and PHP right into your IM &#8211; Add lyricsfly@gtalkbots.com</a> (17)</li><li><a href="http://abhinavsingh.com/blog/2009/05/how-to-broadcast-a-message-to-your-gtalk-friends-using-jaxl/" title="How to broadcast a message to your Gtalk friends using JAXL?">How to broadcast a message to your Gtalk friends using JAXL?</a> (13)</li><li><a href="http://abhinavsingh.com/blog/2009/01/how-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom/" title="How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com">How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com</a> (8)</li><li><a href="http://abhinavsingh.com/blog/2009/01/introducing-jaxl-open-source-jabber-xmpp-library/" title="Introducing JAXL &#8211; Open Source Jabber XMPP Library">Introducing JAXL &#8211; Open Source Jabber XMPP Library</a> (93)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://abhinavsingh.com/blog/2008/11/what-happens-before-you-finally-viewed-this-page/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>games@gtalkbots.com &#8211; Online gaming enabled on Gtalk</title>
		<link>http://abhinavsingh.com/blog/2008/11/gamesgtalkbotscom-online-gaming-enabled-on-gtalk/</link>
		<comments>http://abhinavsingh.com/blog/2008/11/gamesgtalkbotscom-online-gaming-enabled-on-gtalk/#comments</comments>
		<pubDate>Sun, 02 Nov 2008 13:42:22 +0000</pubDate>
		<dc:creator>Abhinav Singh</dc:creator>
				<category><![CDATA[XMPP]]></category>
		<category><![CDATA[Anagram]]></category>
		<category><![CDATA[Gtalk]]></category>
		<category><![CDATA[Gtalkbots]]></category>
		<category><![CDATA[Online Games]]></category>

		<guid isPermaLink="false">http://abhinavsingh.com/blog/2008/11/gamesgtalkbotscom-online-gaming-enabled-on-gtalk/</guid>
		<description><![CDATA[Anagram, many of you might be familiar with it or even played many a times back in school and colleges. Its a simple text based game, where you are given a jumbled word and you need to re-arrange it. E.g. You will be given huldos and you need to quickly identify that as should. So [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2008%2F11%2Fgamesgtalkbotscom-online-gaming-enabled-on-gtalk%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2008%2F11%2Fgamesgtalkbotscom-online-gaming-enabled-on-gtalk%2F&amp;source=imoracle&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f027b5a79a20a49b713f16282f1e0857&amp;hashtags=Anagram,Gtalk,Gtalkbots,Online+Games&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p><span style="font-style: italic;">Anagram</span>, many of you might be familiar with it or even played many a times back in school and colleges. Its a simple text based game, where you are given a jumbled word and you need to re-arrange it. E.g. You will be given <span style="font-style: italic;">huldos</span> and you need to quickly identify that as <span style="font-style: italic;">should</span>.</p>
<p>So getting bored back in college or office, add <span style="font-weight: bold;">games@gtalkbots.com</span> and type <span style="font-weight: bold;">anagram</span> to start gaming. Play and score well. Your score will turn up on the Gtalkbots front page. They have kept this game open for the world i.e. one can play this game even without registering at Gtalkbots.</p>
<p>A few important points:</p>
<ol>
<li>Add <span style="font-weight: bold;">games@gtalkbots.com</span> as your friend in Gtalk Messenger.</li>
<li>Type <span style="font-weight: bold;">rules</span> to read them before you start gaming.<br />
<img src="http://1.bp.blogspot.com/_DRGeZF9Zbaw/SQo-zF5MZAI/AAAAAAAAALM/HAhuYryYs4k/s400/rules.bmp" style="border: 1px solid rgb(68, 68, 68); padding: 2px;" /></li>
<li>Type <span style="font-weight: bold;">anagram</span> to start gaming.</li>
<li>You will be given a jumbled word which you needs to rearrange and reply back.</li>
<li>If your answer is correct you get <span style="font-weight: bold;">10 Points</span>.</li>
<li>If your answer is not correct and you are finding it tough to solve it, Type <span style="font-weight: bold;">hint</span> to get a clue, and a clue will be sent to all users playing the game.<br />
<img src="http://1.bp.blogspot.com/_DRGeZF9Zbaw/SQpAOVdf6yI/AAAAAAAAALU/YoGCjXnrgH4/s400/anagram.bmp" style="border: 1px solid rgb(68, 68, 68); padding: 2px;" /></li>
<li><span style="font-weight: bold; color: rgb(255, 0, 0);">DO NOT FORGET</span> to type <span style="font-weight: bold;">exit</span> when you are finished gaming. If you forget to do so, you will be considered as a part of next round being played and eventually your average score decreases.</li>
<li>If total number of <span style="font-weight: bold;">wrong answers = 5 (including all users)</span>, the bot will automatically reply back with correct answer and moves to the next word.</li>
</ol>
<p>So try out and enjoy.</p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2008%2F11%2Fgamesgtalkbotscom-online-gaming-enabled-on-gtalk%2F"];var wordpress_toolbar_url = "http://abhinavsingh.com/blog/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZy8yMDA4LzExL2dhbWVzZ3RhbGtib3RzY29tLW9ubGluZS1nYW1pbmctZW5hYmxlZC1vbi1ndGFsay88d3B0Yj5nYW1lc0BndGFsa2JvdHMuY29tICYjODIxMTsgT25saW5lIGdhbWluZyBlbmFibGVkIG9uIEd0YWxrPHdwdGI%2BaHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZzx3cHRiPkFiaGkmIzAzOTtzIFdlYmxvZw%3D%3D";</script><ul class="related_post"><li><a href="http://abhinavsingh.com/blog/2009/05/how-to-broadcast-a-message-to-your-gtalk-friends-using-jaxl/" title="How to broadcast a message to your Gtalk friends using JAXL?">How to broadcast a message to your Gtalk friends using JAXL?</a> (13)</li><li><a href="http://abhinavsingh.com/blog/2009/01/how-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom/" title="How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com">How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com</a> (8)</li><li><a href="http://abhinavsingh.com/blog/2009/01/introducing-jaxl-open-source-jabber-xmpp-library/" title="Introducing JAXL &#8211; Open Source Jabber XMPP Library">Introducing JAXL &#8211; Open Source Jabber XMPP Library</a> (93)</li><li><a href="http://abhinavsingh.com/blog/2008/09/save-your-and-your-friends-status-messages-share-and-promote-your-website-through-your-status/" title="Save your and your friend&#039;s status messages. Share and promote your website through your status">Save your and your friend&#039;s status messages. Share and promote your website through your status</a> (1)</li><li><a href="http://abhinavsingh.com/blog/2008/09/gtalk-status-message-collector/" title="GTalk Status Message Collector">GTalk Status Message Collector</a> (3)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://abhinavsingh.com/blog/2008/11/gamesgtalkbotscom-online-gaming-enabled-on-gtalk/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Save your and your friend&#039;s status messages. Share and promote your website through your status</title>
		<link>http://abhinavsingh.com/blog/2008/09/save-your-and-your-friends-status-messages-share-and-promote-your-website-through-your-status/</link>
		<comments>http://abhinavsingh.com/blog/2008/09/save-your-and-your-friends-status-messages-share-and-promote-your-website-through-your-status/#comments</comments>
		<pubDate>Sun, 14 Sep 2008 09:02:32 +0000</pubDate>
		<dc:creator>Abhinav Singh</dc:creator>
				<category><![CDATA[XMPP]]></category>
		<category><![CDATA[Bots]]></category>
		<category><![CDATA[Gtalk]]></category>
		<category><![CDATA[Gtalkbots]]></category>
		<category><![CDATA[Promote]]></category>
		<category><![CDATA[Share]]></category>
		<category><![CDATA[Status Message]]></category>

		<guid isPermaLink="false">http://abhinavsingh.com/blog/2008/09/save-your-and-your-friends-status-messages-share-and-promote-your-website-through-your-status/</guid>
		<description><![CDATA[Hello Everyone, http://gtalkbots.com Here is this new website which help you save your and your friends Gtalk status messages. It also provides a social bookmarking feature with a different edge. Are you fed up with posting your website and blogs at digg.com, delicious, stumble or any other such site there. If not, you must surely [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2008%2F09%2Fsave-your-and-your-friends-status-messages-share-and-promote-your-website-through-your-status%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2008%2F09%2Fsave-your-and-your-friends-status-messages-share-and-promote-your-website-through-your-status%2F&amp;source=imoracle&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f027b5a79a20a49b713f16282f1e0857&amp;hashtags=Bots,Gtalk,Gtalkbots,Promote,Share,Status+Message&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello Everyone,</p>
<p><a href="http://gtalkbots.com">http://gtalkbots.com</a></p>
<p>Here is this new website which help you save your and your friends Gtalk status messages. It also provides a social bookmarking feature with a different edge.</p>
<p>Are you fed up with posting your website and blogs at digg.com, delicious, stumble or any other such site there. If not, you must surely be fed up with the hard work you need to do to make sure your link reach out to millions out there. Well through this site, you just need to put your blog and site link as your gtalk status message and this site will&nbsp; make sure it reaches to the relevant audience out there without any sweat from your.</p>
<p>Try out, promote, enjoy, comment and let me know your feedbacks.</p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2008%2F09%2Fsave-your-and-your-friends-status-messages-share-and-promote-your-website-through-your-status%2F","http:\/\/gtalkbots.com"];var wordpress_toolbar_url = "http://abhinavsingh.com/blog/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZy8yMDA4LzA5L3NhdmUteW91ci1hbmQteW91ci1mcmllbmRzLXN0YXR1cy1tZXNzYWdlcy1zaGFyZS1hbmQtcHJvbW90ZS15b3VyLXdlYnNpdGUtdGhyb3VnaC15b3VyLXN0YXR1cy88d3B0Yj5TYXZlIHlvdXIgYW5kIHlvdXIgZnJpZW5kJiMwMzk7cyBzdGF0dXMgbWVzc2FnZXMuIFNoYXJlIGFuZCBwcm9tb3RlIHlvdXIgd2Vic2l0ZSB0aHJvdWdoIHlvdXIgc3RhdHVzPHdwdGI%2BaHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZzx3cHRiPkFiaGkmIzAzOTtzIFdlYmxvZw%3D%3D";</script><ul class="related_post"><li><a href="http://abhinavsingh.com/blog/2008/09/gtalk-status-message-collector/" title="GTalk Status Message Collector">GTalk Status Message Collector</a> (3)</li><li><a href="http://abhinavsingh.com/blog/2009/05/how-to-broadcast-a-message-to-your-gtalk-friends-using-jaxl/" title="How to broadcast a message to your Gtalk friends using JAXL?">How to broadcast a message to your Gtalk friends using JAXL?</a> (13)</li><li><a href="http://abhinavsingh.com/blog/2009/01/how-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom/" title="How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com">How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com</a> (8)</li><li><a href="http://abhinavsingh.com/blog/2009/01/introducing-jaxl-open-source-jabber-xmpp-library/" title="Introducing JAXL &#8211; Open Source Jabber XMPP Library">Introducing JAXL &#8211; Open Source Jabber XMPP Library</a> (93)</li><li><a href="http://abhinavsingh.com/blog/2008/11/gamesgtalkbotscom-online-gaming-enabled-on-gtalk/" title="games@gtalkbots.com &#8211; Online gaming enabled on Gtalk">games@gtalkbots.com &#8211; Online gaming enabled on Gtalk</a> (2)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://abhinavsingh.com/blog/2008/09/save-your-and-your-friends-status-messages-share-and-promote-your-website-through-your-status/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>GTalk Status Message Collector</title>
		<link>http://abhinavsingh.com/blog/2008/09/gtalk-status-message-collector/</link>
		<comments>http://abhinavsingh.com/blog/2008/09/gtalk-status-message-collector/#comments</comments>
		<pubDate>Sat, 06 Sep 2008 18:08:35 +0000</pubDate>
		<dc:creator>Abhinav Singh</dc:creator>
				<category><![CDATA[XMPP]]></category>
		<category><![CDATA[Bots]]></category>
		<category><![CDATA[Gtalk]]></category>
		<category><![CDATA[Gtalkbots]]></category>

		<guid isPermaLink="false">http://abhinavsingh.com/blog/2008/09/gtalk-status-message-collector/</guid>
		<description><![CDATA[Hello Everyone, I have started http://gtalkbots.com , based on the example demonstrated here. Try out and Help spreading the word. I am not a big fan of twitter, but after I heard they do something similar to what I will be demonstrating here. I thought of building this one out. So here is my demo [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: right; margin-left: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2008%2F09%2Fgtalk-status-message-collector%2F"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2008%2F09%2Fgtalk-status-message-collector%2F&amp;source=imoracle&amp;style=normal&amp;service=bit.ly&amp;service_api=R_f027b5a79a20a49b713f16282f1e0857&amp;hashtags=Bots,Gtalk,Gtalkbots&amp;b=2" height="61" width="50" /><br />
			</a>
		</div>
<p>Hello Everyone,</p>
<p><strong>I have started <a href="http://gtalkbots.com" target="_blank">http://gtalkbots.com</a> , based on the example demonstrated here. Try out and Help spreading the word.</strong></p>
<p>I am not a big fan of twitter, but after I heard they do something similar to what I will be demonstrating here. I thought of building this one out. So here is my demo application, also known as GTalk Chat Bot.</p>
<p>Do the following things to get started:</p>
<ol>
<li>Add <a href="mailto:abhinav.bot@gmail.com">abhinav.bot@gmail.com</a> in your GTalk Messenger.</li>
<li>It will collect your status messages as and when you change them.</li>
<li>You can view all your status messages by visiting this URL : <a href="http://abhinavsingh.com/webdemos/chatbot/">http://abhinavsingh.com/webdemos/chatbot/</a></li>
<li>The status messages will reflect at the above URL by the end of the day. (I had to do this because the server where I have my bot running i.e. my VPS is different from where my personal site is hosted, hence we have this restriction)</li>
<li>Come back anytime after a day and you can see your status messages over time.</li>
</ol>
<p>I am currently testing this application, which is running 99.99% bug free. Once I am satisfied with it, I will put the code for download with a possible explaination.</p>
<p>Meanwhile enjoy the bot.</p>
<p>Thanks.</p>
<script type="text/javascript">var wordpress_toolbar_urls = ["http:\/\/api.tweetmeme.com\/share?url=http%3A%2F%2Fabhinavsingh.com%2Fblog%2F2008%2F09%2Fgtalk-status-message-collector%2F","http:\/\/gtalkbots.com","mailto:abhinav.bot@gmail.com","http:\/\/abhinavsingh.com\/webdemos\/chatbot\/"];var wordpress_toolbar_url = "http://abhinavsingh.com/blog/wp-content/plugins/wordpress-toolbar/toolbar.php";var wordpress_toolbar_oinw = "oinw";var wordpress_toolbar_hash = "aHR0cDovL2FiaGluYXZzaW5naC5jb20vYmxvZy8yMDA4LzA5L2d0YWxrLXN0YXR1cy1tZXNzYWdlLWNvbGxlY3Rvci88d3B0Yj5HVGFsayBTdGF0dXMgTWVzc2FnZSBDb2xsZWN0b3I8d3B0Yj5odHRwOi8vYWJoaW5hdnNpbmdoLmNvbS9ibG9nPHdwdGI%2BQWJoaSYjMDM5O3MgV2VibG9n";</script><ul class="related_post"><li><a href="http://abhinavsingh.com/blog/2008/09/save-your-and-your-friends-status-messages-share-and-promote-your-website-through-your-status/" title="Save your and your friend&#039;s status messages. Share and promote your website through your status">Save your and your friend&#039;s status messages. Share and promote your website through your status</a> (1)</li><li><a href="http://abhinavsingh.com/blog/2009/05/how-to-broadcast-a-message-to-your-gtalk-friends-using-jaxl/" title="How to broadcast a message to your Gtalk friends using JAXL?">How to broadcast a message to your Gtalk friends using JAXL?</a> (13)</li><li><a href="http://abhinavsingh.com/blog/2009/01/how-to-get-dzone-feeds-as-im-using-jaxl-add-dzonegtalkbotscom/" title="How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com">How to get dzone feeds as IM using JAXL? Add dzone@gtalkbots.com</a> (8)</li><li><a href="http://abhinavsingh.com/blog/2009/01/introducing-jaxl-open-source-jabber-xmpp-library/" title="Introducing JAXL &#8211; Open Source Jabber XMPP Library">Introducing JAXL &#8211; Open Source Jabber XMPP Library</a> (93)</li><li><a href="http://abhinavsingh.com/blog/2008/11/gamesgtalkbotscom-online-gaming-enabled-on-gtalk/" title="games@gtalkbots.com &#8211; Online gaming enabled on Gtalk">games@gtalkbots.com &#8211; Online gaming enabled on Gtalk</a> (2)</li></ul>]]></content:encoded>
			<wfw:commentRss>http://abhinavsingh.com/blog/2008/09/gtalk-status-message-collector/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>

