Archive

Archive for October, 2008

Top 5 questions from stackoverflow

October 22nd, 2008

Create a simple Twitter IM bot

October 12th, 2008

Some time back I worte a post about a Twitter Google bot in www.crankup.net. As promised, here is how you can develop your own google talk bot which can post your messages to Twitter.

First, You need an imified account for your bot to work properly. Get one here. Once the account is created, login to your account and give your new bot a name. I call it Post2Twitter.

Now its time to develop the bot. I have used PHP to post message from the chat window to twitter.Below is the code.

<?php
error_reporting(0);
require('twitterAPI.php');
$message = $_REQUEST['msg'];
if(isset($message))
{
$extracted = explode("$",$message);
$twitter_username = $extracted[0]; 
$twitter_psw = $extracted[1];
$twitter_message = $extracted[2];
 
if(strlen($twitter_message)<1){
	echo "Sorry! Please enter a message to post!";
	exit(0);
	} else {
	$twitter_status=postToTwitter($twitter_username, $twitter_psw, $twitter_message);
	}
}
 ?>

Looks simple? Infact it is not. I have used anoter file which will post the message to twitter. Get the include file here.

Now upload both the files to a webserver and provide the url in your bot setting page (imified.com).Once this is done you can invite your bot to your google talk and start having fun. The above code is self explanatory if you have any queries please post it as a comment.

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban Uncategorized, php

indiayellowpages.com coding standards

October 8th, 2008

My friend sent me this screenshot today. He tried to open www.indiayellowpages.com and this is what he got.

[Click the image for a bigger view]

  1. Option explicit commented out
  2. All the databse names are revealed. I was able to download a DB using google search. Shhh!! dont tell anyone
  3. Worst naming standards eg: main1.mdb,hitsfile1.txt
  4. Worst naming convention for variables eg: zz,zz1

I can think of only one quote now

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.

I have never seen such a worst coding standard.

[Post to Twitter]   [Post to Plurk]   [Post to Digg]   [Post to ping.fm]

Related posts

Shoban links