Perling! :p Yahoo Status check

Well i while googling around found a web that tells you the status of a yahoo id weather its

online\offline\invisible  i have neva coded in perl so thought of giving it a try.

I have written this piece of code to retrive status from that web about an id 
if its online or not!! The below code is a

total mess but still Works 😉

#!/usr/local/bin/perl
$number = $#ARGV + 1;
#Checks parameters.!
if (!$number) {
print(“Checks Yahoo status !! ./azeem\n”);
print(“Pattern is $0 Yahoo_id\n”);
exit;
}
# The rest of the stuff!
$request = ‘curl http://invisible.ir/getstatus?yahooid=’;
$request .= $ARGV[0];
$result = system($request);
$online = rindex($result, “online”);
$offline = rindex($result,”offline”);
$invisible = rindex($result,”invisible”);

if ( $online != -1 ) {
print “$0 is Online!\n”;
exit;
}else {
if ( $offline != -1 ) {
print “$0 is Offline!\n”;
exit;
} else {
if ( $invisible != -1 )
{
print “$0 is Invisible!! “;
}
}

}

Advertisements

~ by Azeem on February 20, 2008.

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

 
%d bloggers like this: