Saturday, June 30, 2007

Apple I-Phone Snaps




Menu


Dimensions


Maps


Inbox


Internet


Media Player

Loose (iTunes Version)


Keyboard


Voicemail


Stocks



© Apple Corp.

Saturday, June 23, 2007

JSON- Javascript Object Notation

Intro
JSON stands for Javascript Object Notation. JSON is a way of writing or expressing JavaScript Objects so that it can be easily read by both the computer and humans. Unlike XML or eXtensible Mark up Language the JSON is much more compact and easier to Parse.

XML takes the form


<Tag>
<Tag2>Information</Tag2>
<Tag>


JSON takes the form

var obj = {
an_array : [element1, element2 , element3 ....],
a_property : "property",
a_multi_array : [ [,,,],[,,,],...]
};


In order to parse an XML response, we have to use the following notation,
Suppose we are returning an XML response from a server using Ajax. The common method to extract the useful information is :

var xml = xmlHttp.responseXML;
var list= xml.getElementsByTagName("TAG");

for(i=0;i < list.length;i++)
{
// loop through and extract the values
}


This can be replaced with the new JSON object notation by

var strobj = xmlHttp.responseText;
var obj = eval("("+strobj+")");
obj.an_array[0];
obj.a_multi_array[0][0];
// ....


The Notation
All object lies between the { }
each of the properties has a label and an associated value or an array.
It is specified as label : value
a , separates the label-value pairs.
Arrays are enclosed in square brackets [ ] and comma separated.

In short a JSON object looks like

var blog = {
name: "the Digital Me",
author : "arun prabhakar",
pages : ["http://url1/","http://url2/"];
complexarray: [[0,10,10],[7,5,7],[1,9,8],[7,1,4]];
};


JSON and PHP
PHP has 2 built in functions to help with the JSON format.
json_encode
json_decode

Links

json.org
php.net JSON Functions

Tuesday, June 19, 2007

Yahoo! Built in chat with mail

Yahoo!
Catches up with Google and introduces the same Inbox + Messenger bundle. On the new yahoo mail beta now you can chat to your friends too.





At first look yea it rocks. It has almost all the formatting and smilies used by messenger. (Of course the Gizmos are missing).

But still gmail is ahead because, gmail allows you to be signed in on more than one place. For eg: mail and google talk. Yahoo does not allow that when you sign in inside the mail, you get disconnected on the messenger. I donno about you but hmmm I dint like that.

Secondly the gMail client is neatly presented on top of your mails, So you can go on reading the mails while your slow friend is finding the keys on keyboard ;)
Third, I hate that advertisement on the right edge! And most importantly it refreshes too often making it a pain! Of course I know free always implies filled with ads , but I guess this is a little too much.

What do you think?

Sunday, June 17, 2007

Perl Script to HTML formatter

Intro
This script converts a Perl Script to HTML so that it looks good with colour code formatting for keywords and variables. This isn't yet completed and may contain bugs but I guess its worth posting. Anyone is free to modify and redistribute the code as long as the first line remains intact.

Usage


perl format.pl ScriptFile.pl

Output will be saved as ScriptFile.pl.html

Script

style="color:#0ff">$cnt =~ s/&/&amp;/g;

$cnt =~ s/</&lt;/g;

$cnt =~ s/>/&gt;/g;







#Keywords



$keywords =~ s/ /)|(?:/g;



#Comments

$cnt =~ s/$singlecomment(.*)\n/<span style="color:#080">$singlecomment$1<\/span>\n/g;



$cnt =~ s/(?:<.*?>)*([\s)\[{;])((?:$keywords))([\s\[{(;])(?:<\/.*?>)*/$1<span style="color:#008;font-weight:bold;">$2<\/span>$3/g;

$cnt =~ s/([^\\])([\@\$].*?)([^a-zA-Z0-9_])/$1<span style="color:#0ff">$2<\/span>$3/g;



print $ARGV[0].".html";

open FILE,">".$ARGV[0].".html";

print FILE "<pre>$cnt</pre>";

close FILE;




Found a bug? (Plenty I know)
Post a comment with Line Number , Code , Correction.

Orkut Perl Script - Login, Scrapper and more

Intro
This is a PERL script that logs you into Orkut and allows you to scrap yiur friends. Following is the program and beneath it lies the manual to use the program. I assume that you already have PERL installed on your system with the required modules:

  • LWP
  • WWW::Mechanize


Program
#! /usr/bin/perl -w

use WWW::Mechanize;
use HTTP::Cookies;
use HTTP::Request::Common;

use subs qw(print_c login logout home grab proces scrap);


#autoflush STDOUT 1;

printf ("%45s","Command Line Orkut\n");
printf ("%50s","By http://digitalpbk.blogspot.com\n");

#inits
$cj=HTTP::Cookies->new(file => "cookie.jar",autosave=>1,ignore_discard=>1);
$mech = WWW::Mechanize->new(cookie_jar => $cj);

@prc = ("\n","[FAILED]","[ OK ]\n");
#main loop
print_c;
while(<STDIN>)
{
chomp;
@args = split(/ /);

if(@args)
{
exit 0 if($args[0] eq "exit" || $args[0] eq "q");

if($args[0] eq "login") {login(@args);}
elsif($args[0] eq "home") {home(@args);}
elsif($args[0] eq "logout") {logout(@args);}
elsif($args[0] eq "grab") {grab(@args);}
elsif($args[0] eq "process") {proces(@args);}
elsif($args[0] eq "scrap") {scrap(@args);}
elsif($args[0] eq "populate") {populate(@args);}
elsif($args[0] eq "captchaget") {captchaget(@args);}
elsif($args[0] eq "clear") {system("clear");}
print "\n";
}
print_c;
}

exit 0;


sub print_c
{
print "";
print "> ";
print "";
}

sub login
{


print "\nGmail iD : ";
$email = <STDIN>;
print "Password : ";
$pass = <STDIN>;
print $prc[0];

chomp $email;chomp $pass;

RELOGIN:
for($i=3; $i>=0;$i--)
{
printf("%-60s","GET /Home.aspx");
$mech->get("http://www.orkut.com/Home.aspx");
last if($mech->success());

printf("%10s",$prc[1]);
print " Retry (",$i,")".$prc[0] if($i);
}

return if($i<=0);
print $prc[2];


$cnt = $mech->response->as_string;
$cnt =~ s/\n|\s+/ /g;

if($mech->title =~ m/orkut.*home/i)
{
print "\nAlready Logged In",$prc[0];

$cnt =~ m/<b>(.*)\@gmail.com<\/b>/;

print "\nLogout $1?[n] : ";
$com=<STDIN>;chomp $com;
if($com eq "y")
{
logout;
goto RELOGIN;
}
else
{
return;
}
}

$cnt = $mech->response->as_string;
$cnt =~ s/\n|\s+/ /g;

printf("%-60.59s","Parsing for Login Page ");
#print $cnts;
if($cnt !~ m/id='liframe'.*?src='(.*)'/)
{
printf("%10s",$prc[1]);
print " Login page URL Not Found!\nTry Again OR Update the script! ".$prc[0];

return;
}

print $prc[2];
$url = $1;
$j=3;
REDO:
for($i=3;$i>=0;$i--)
{
printf("%-60.59s","GET $url");
$mech->get($url);
last if($mech->success());

printf("%10s",$prc[1]);
print " Retry (",$i,")".$prc[0] if($i);
}

return if($i<=0);

print $prc[2];

$cnt = $mech->response->as_string;
$cnt =~ s/\n|\s+/ /g;

$mech->form_number(1);
$mech->field("Email",$email."\@gmail.com");
$mech->field("Passwd",$pass);


printf("%-60.59s","Logging In ... ");

$mech->click("null");

$j--;
if($j && !$mech->success())
{
printf("%10s\n",$prc[1]);
goto REDO;
}
return unless($j);

$cnt = $mech->response->as_string;
$cnt =~ s/\n|\s+/ /g;

if(!$mech->find_link(text => "click here to continue"))
{
printf("%10s",$prc[1]);
print "\nWrong Usename or Password!",$prc[0];
return;
}


print $prc[2];
for($i=3;$i>=0;$i--)
{
printf("%-60.59s","Continuing ...");
$mech->follow_link(text => "click here to continue");
last if($mech->success());

printf("%10s",$prc[1]);
print " Retry (",$i,")".$prc[0] if($i);
}

return if($i<=0);

print $prc[2];

printf("%-60s","Parsing REDIRECT URL");
$cnt = $mech->response->as_string;
$cnt =~ s/\n|\s+/ /g;

if($cnt !~ m/location.replace\("(.*)"\)/)
{
printf("%10s",$prc[1]);
print "\nRedirect script missing!",$prc[0];
return;
}

$url = $1;
$url =~ s/\\u003d/=/g;

print $prc[2];
for($i=3;$i>=0;$i--)
{
printf("%-60.59s","GET $url");
$mech->get($url);
last if($mech->success());

printf("%10s",$prc[1]);
print " Retry (",$i,")".$prc[0] if($i);
}
return if($i<=0);

print $prc[2];
print "Logged In!";

#for($i=3; $i>=0;$i--)
#{
# printf("\n%-60s","GET /Home.aspx");
# $mech->get("http://www.orkut.com/Home.aspx");
# last if($mech->success());
#
# printf("%10s",$prc[1]);
# print " Retry (",$i,")".$prc[0] if($i);
#}

#return if($i<=0);
#print $prc[2];

}

sub logout
{

printf("%-60s","Parsing Logout");
if(!$mech->find_link(text => "Logout"))
{
printf("%10s",$prc[1]);
print "\nNot Logged In?",$prc[0];
return;
}


print $prc[2];
for($i=3;$i>=0;$i--)
{
printf("%-60.59s","Logging Out ...");
$mech->follow_link(text => "Logout");
last if($mech->success());

printf("%10s",$prc[1]);
print " Retry (",$i,")".$prc[0] if($i);
}
return if($i<=0);

print $prc[2];
}

sub home
{
REHOME:
for($i=3; $i>=0;$i--)
{
printf("%-60s","GET /Home.aspx");
$mech->get("http://www.orkut.com/Home.aspx");
last if($mech->success());

printf("%10s",$prc[1]);
print " Retry (",$i,")".$prc[0] if($i);
}

if($i<=0)
{
print $mech->response->as_string;
return;
}
print $prc[2];

if($mech->title !~ m/orkut.*home/i)
{

print $mech->response->as_string;
print "Not Logged In!",$prc[0];
print "\nLogin? [y] : ";
$com=<STDIN>;chomp $com;
if(not($com eq "n"))
{
login;
goto REHOME;
}
else
{
return;
}
}

#$mech->save_content("home.html");

$cnt = $mech->response->as_string;
$cnt =~ s/\n|\s+/ /g;
if($cnt =~ m/You are connected to <b>(.*)<\/b> people through <b>(.*)<\/b> friends./){
printf("\n%-20s: %0s (%0s)","Friends",$2,$1);}

if($cnt =~ m/([0-9]+) fans/){
printf("\n%-20s: %0s","Fans",$1);}

if($cnt =~ m/<b>([0-9]+)<\/b> scraps/i){
printf("\n%-20s: %0s","Scraps",$1);}

$cnt =~ m/my friends/g;
print "\nRecent : ";
while($cnt =~ m/Profile\.aspx\?uid=(.*?)">(<b>)*([^<]+)(<\/b>)*<\/a>/g)
{
print "\n\t$3";
}
}

sub grab_community
{
$comid = shift;
unless($file = shift)
{
print "\nFile to store : ";
$file = <STDIN>;
chomp $file;
}

$url = "/CommMembers.aspx?cmm=$comid";


for($i=3; $i>=0;$i--)
{
printf("%-60s","GET $url");
$mech->get("http://www.orkut.com$url");
last if($mech->success());

printf("%10s",$prc[1]);
print " Retry (",$i,")".$prc[0] if($i);
}

return 0 if($i<=0);
print $prc[2];

if($mech->title !~ m/orkut.*Community.*Members/)
{
print "Unexpected Page ! : ",$mech->title;
return 0;
}


$cnt = $mech->response->as_string;
#$cnt =~ m/showing <b>1-15<\/b> of (.*?)<\/b>/g;
#print " $1";

open APP,">$file";
$grabed=0;
printf("%-25s","Grabbed: $grabed ");
for($page=2;;$page++)
{
while($cnt =~ m/Profile\.aspx\?uid=(.*?)">(<b>)*([^<]+)(<\/b>)*<\/a>/g)
{
$grabed++;
print APP "\n$1>$3";
}
print "\e[25D";
printf("%-25s","Grabbed: $grabed ");
sleep(3);
if($mech->find_link(text_regex => qr/next/i))
{
$mech->follow_link(text_regex => qr/next/i);
}
else
{
last;
}

last if(!$mech->success());

$cnt = $mech->response->as_string;
}
print "\nSaved to \"$file\"".$prc[0];
close APP;
return $grabed;
}

sub grab_flist
{

$comid = shift;
unless($file = shift)
{
print "\nFile to store : ";
$file = <STDIN>;
chomp $file;
}

$url = "/FriendsList.aspx?uid=$comid";


for($i=3; $i>=0;$i--)
{
printf("%-60s","GET $url");
$mech->get("http://www.orkut.com$url");
last if($mech->success());

printf("%10s",$prc[1]);
print " Retry (",$i,")".$prc[0] if($i);
}

return 0 if($i<=0);
print $prc[2];

if($mech->title !~ m/orkut - (.*) Friends/)
{
print "Unexpected Page ! : ",$mech->title;
return 0;
}

print "$1 Friends : ".$prc[0];
$cnt = $mech->response->as_string;
#$cnt =~ m/showing <b>1-15<\/b> of (.*?)<\/b>/g;
#print " $1";

#$file =~ s/>//;
open APP,">$file";
$grabed=0;
printf("%-25s","Grabbed: $grabed ");
for($page=2;;$page++)
{
$cnt =~ m/Profile\.aspx\?uid=(.*?)">(<b>)*([^<]+)(<\/b>)*<\/a>/g;
while($cnt =~ m/Profile\.aspx\?uid=(.*?)">(<b>)*([^<]+)(<\/b>)*<\/a>/g)
{
$grabed++;
print APP "\n$1>$3";
}
print "\e[25D";
printf("%-25s","Grabbed: $grabed ");
sleep(3);
if($mech->find_link(text=> $page))
{
$mech->follow_link(text => $page);
}
else
{
last;
}

last if(!$mech->success());

$cnt = $mech->response->as_string;
}
print "\nSaved to \"$file\"".$prc[0];
close APP;
return $grabed;
}

sub grab_wild
{
$limit = shift;
$got = 0;
my $file;

unless($file=shift)
{
print "\nFile to store : ";
$file = <STDIN>;
chomp $file;
}


print "\nCommunity ID : ";
$comid = <STDIN>;chomp $comid;


open APP4, ">>$file";
print APP4 "\n<comment>CommMem $comid</comment>";
close APP4;

if($comid)
{
$got = grab_community($comid,">$file");
}
else
{
print "\nFriend ID : ";
$comid=<STDIN>;chomp $comid;
print $comid;
return 0 unless($comid);

open APP3, ">>$file";
print APP3 "\n<comment>FriendOf $comid</comment>";
close APP3;

$got = grab_flist($comid,">$file");
}

return 0 unless($got);

$offset=0;
$visits=0;
RESPIDER:
$file =~ s/>//;
open DLL, "$file";
@uids = <DLL>;
close DLL;

$cnt = join("\n",@uids);
$cnt =~ s/<comment>.*?<\/comment>//g;
@uids = split(/\n/,$cnt);
@uids = @uids[$offset..$#uids];

foreach $userid (@uids)
{
if($userid =~ m/([0-9]+)>/)
{
$file =~ s/>//;
if(open APP2, ">>$file")
{
print APP2 "\n<comment>FriendOf $1</comment>";
close APP2;
}
else {print $!," $file";exit}

$got+= grab_flist($1,">$file");
$visits++;
print " Got $got ".$prc[0];
last if($limit < $got);
}
}
if($limit > $got)
{
$offset = $#uids + 1;
goto RESPIDER;
}
print "\n Spider Results : ".$prc[0];
printf("%-30s : %0s\n","Indexed",$got);
printf("%-30s : %0s\n","Spidered",$visits);
print " Tip : Dont forget to simplify the uid file ".$prc[0];
}

sub grab
{
shift;
$what = shift;
$where = shift;
$file = shift;
if(!($what && $where))
{

print "\nArguments missing".$prc[0];
return;
}
if(lc($what) eq "comm" || lc($what) eq "community") {grab_community($where,$file);}
elsif(lc($what) eq "flist" || lc($what) eq "friendlist") {grab_flist($where,$file);}
elsif(lc($what) eq "wild") {grab_wild($where,$file);}
}



sub process_uids
{
my $file;
unless($file=shift)
{
print "\nFile to read : ";
$file = <STDIN>;
chomp $file;
}

open DLL, "$file";
@uids = <DLL>;
close DLL;

$cnt = join("\n",@uids);
$cnt =~ s/<comment>.*?<\/comment>\n//g;
$cnt =~ s/[\n]+/>/g;
$cnt =~ s/>//;

%hc = split(/>/,$cnt);

$file .= ".s";
if($dest = shift) {$file=$dest;}

open DLL,">$file" or die("$!");

$inx=0;
foreach $key (sort keys %hc)
{
$val = $hc{$key};
$inx++;
printf("%6d %28s %0s\n",$inx,"$key","$val");
print DLL "$key>$val>";
}
close DLL;

}


sub proces
{
shift;
$what = shift;
$file = shift;
$extra = shift;
unless($what)
{
print "\nArguments missing".$prc[0];
return;
}

if(lc($what) eq "uids") {process_uids($file,$extra); }

}






sub scrap
{
shift;
$pat = shift;

unless($source=shift)
{
print "\nFile to read : ";
$source = <STDIN>;
chomp $source;
}

if(!open FILE,"$source")
{
print " File not found!".$prc[0];
return;
}
@contents = <FILE>;
close FILE;
chomp @contents;
$cnts = join("",@contents);

$cnts =~ s/<//g;

%hc = split(/>/,$cnts);
$no = 1;
$scrapall=0;
$sc_start=0;
$sc_end=0;
@fkeys=();

$pat = ".*" unless($pat);

foreach $key (sort keys %hc)
{
$val = $hc{$key};
if($val =~ m/$pat/i)
{
printf("%6d %28s %0s\n",$no,"$key","$val");
$no++;
push @fkeys, $key;
}
}

if($no==0)
{
print " Friend Not found !".$prc[0];
}

print "Enter Friend # : ";
$myc = <STDIN>;
chomp $myc;
#todos ...

if($myc =~ m/([0-9]+)-([0-9]+)/)
{
$scrapall=1;
$myc=$sc_start=$1;
$sc_end=$2;
}

if($myc > $no)
{
print "Invalid Response!!!".$prc[0];return;
}
print "Enter Scrap Text : ";
$sctext = <STDIN>;
$sctext =~ s/\\n/\n/g;
#PS: Please do not remove the following if you really like this .... :)
#Please post a link to my website http://digitalpbk.blogspot.com
#thank you :)
$sctext = $sctext."\n[red](Powered by [blue]digitalpbk[/blue].blogspot.com)";
chomp $sctext;

SCRAPNEXT:
$friendid = $fkeys[$myc-1];

print " Scrapping $myc $friendid [$hc{$friendid}]".$prc[0];
sleep(4);
$url = "/Scrapbook.aspx?uid=$friendid";


for($i=3; $i>=0;$i--)
{
printf("%-60s","GET $url");
$mech->get("http://www.orkut.com$url");
last if($mech->success());

printf("%10s",$prc[1]);
print " Retry (",$i,")".$prc[0] if($i);
}


return 0 if($i<=0);
print $prc[2];

$cnt= $mech->response->as_string;
$cnt =~ s/\n|\s+/ /g;

if(($mech->title()) =~ m/orkut.*login/i)
{

print "Not Logged In!",$prc[0];
print "\nLogin? [y] : ";
$com=<STDIN>;chomp $com;
if(not($com eq "n"))
{
login;
goto SCRAPNEXT;
}
else
{
return;
}

sleep(3);
goto SCRAPNEXT;
}


if($cnt =~ m/"POST_TOKEN" value="(.*?)"/){
$post_token = $1;}

#print $post_token," ";
if($cnt =~ m/"signature" value="(.*?)"/){
$signature=$1;}
#print $signature;
sleep(3);
for($i=3;$i>=0;$i--)
{
printf( "%-60s","POST scrap");

#$mech->agent_alias("Linux Mozilla");
$mech->request(POST "http://www.orkut.com$url",["POST_TOKEN"=>$post_token,"signature"=>$signature,"scrapText"=>$sctext,"Action.writeScrapBasic"=>"Submit+Query"]);
last if($mech->success());

printf("%10s",$prc[1]);
print " Retry (",$i,")".$prc[0] if($i);
}

return 0 if($i<=0);
print $prc[2];

if($scrapall && $myc < $sc_end)
{
$myc++;
goto SCRAPNEXT;
}
print " Done.".$prc[0];
}

sub populate
{

shift;
$pat = shift;

unless($source=shift)
{
print "\nFile to read : ";
$source = <STDIN>;
chomp $source;
}

if(!open FILE,"$source")
{
print " File not found!".$prc[0];
return;
}
@contents = <FILE>;
close FILE;
chomp @contents;
$cnts = join("",@contents);

$cnts =~ s/<//g;

%hc = split(/>/,$cnts);
$no = 1;
$scrapall=0;
$sc_start=0;
$sc_end=0;
@fkeys=();

$pat = ".*" unless($pat);

foreach $key (sort keys %hc)
{
$val = $hc{$key};
if($val =~ m/$pat/i)
{
printf("%6d %28s %0s\n",$no,"$key","$val");
$no++;
push @fkeys, $key;
}
}

if($no==0)
{
print " Friend Not found !".$prc[0];
}

print "Enter Friend # : ";

$myc = <STDIN>;
chomp $myc;
#todos ...

if($myc =~ m/([0-9]+)-([0-9]+)/)
{
$scrapall=1;
$myc=$sc_start=$1;
$sc_end=$2;
}

if($myc > $no)
{
print "Invalid Response!!!".$prc[0];return;
}

ADDNEXT:
$friendid = $fkeys[$myc-1];

print " Adding $myc $friendid [$hc{$friendid}]".$prc[0];
sleep(4);
$url = "/FriendAdd.aspx?uid=$friendid";


for($i=3; $i>=0;$i--)
{
printf("%-60s","GET $url");
$mech->get("http://www.orkut.com$url");
last if($mech->success());

printf("%10s",$prc[1]);
print " Retry (",$i,")".$prc[0] if($i);
}


return 0 if($i<=0);
print $prc[2];

$cnt= $mech->response->as_string;
$cnt =~ s/\n|\s+/ /g;

if(($mech->title()) =~ m/orkut.*login/i)
{

print "Not Logged In!",$prc[0];
print "\nLogin? [y] : ";
$com=<STDIN>;chomp $com;
if(not($com eq "n"))
{
login;
goto ADDNEXT;
}
else
{
return;
}

sleep(3);
goto ADDNEXT;
}


if($cnt =~ m/"POST_TOKEN" value="(.*?)"/){
$post_token = $1;}

#print $post_token," ";
if($cnt =~ m/"signature" value="(.*?)"/){
$signature=$1;}
#print $signature;
sleep(3);
for($i=3;$i>=0;$i--)
{
printf( "%-60s","POST add");

#$mech->agent_alias("Linux Mozilla");
$mech->request(POST "http://www.orkut.com$url",["POST_TOKEN"=>$post_token,"signature"=>$signature,"level"=>"3","Action.yes"=>"Submit+Query"]);
last if($mech->success());

printf("%10s",$prc[1]);
print " Retry (",$i,")".$prc[0] if($i);
}

return 0 if($i<=0);
print $prc[2];

if($scrapall && $myc < $sc_end)
{
$myc++;
goto ADDNEXT;
}
print " Done.".$prc[0];



}


sub captchaget
{
$mech->request(GET "http://www.orkut.com/CaptchaImage.aspx");
open JPEG, ">captcha.jpg";

print JPEG $mech->response->content;
close JPEG;

}


Installing and Executing
To Install Copy the above full program. Paste it in a new text file and rename it as orkut.pl.
To Execute the program open a terminal / DOS Prompt and navigate to the folder where you have the orkut.pl.
Then type
perl orkut.pl


Getting Started
Once you execute the program you get a screen as follows

Command Line Orkut
By http://digitalpbk.blogspot.com
>


Quick Start Scrap all your friends

Command Line Orkut
By http://digitalpbk.blogspot.com
> login
> home
> grab flist [uid here Profile.aspx?uid=some numbers right? copy that numbers here]
Enter File : myfriends
> process uids myfriends
> scrap
Enter File : myfreinds.s
1
2
3
4
.
.
.
N
Enter Friend Number: 1-N
Enter Scrap text : This is coooool.




Avaliable commands
  • login: This command is used to Login into Orkut.com, you will have to enter a valid Username and Password to enter the site. If someone is already logged in the command asks your confirmation to logout that person and log you in or to continue with the existing.

    > login

    Gmail ID : example@example.com
    Password : Password

    GET /Home.aspx [ OK ]
    Parsing for Login Page [ OK ]
    GET https://www.google.com/accounts/ServiceLoginBox?service [ OK ]
    Logging In ... [ OK ]
    Continuing ... [ OK ]
    Parsing REDIRECT URL [ OK ]
    GET http://www.orkut.com/RedirLogin.aspx?msg=0&page=http%3A [ OK ]
    Logged In!



  • home: This command parses the Home.aspx file and gives you a summary of the page as shown below. If you are not logged in the command executes the login and continues if successful.

    > home
    GET /Home.aspx [ OK ]

    Friends : 291 (57,431,788)
    Fans : 138
    Scraps : 4
    Recent :
    abcd (305)
    xyz (391)
    def (151)
    I maybe wrong... (301)
    fghhh (376)
    someone (289)
    exmple (673)
    real (679)


    The number in brackets in friends indicate the total number of people in orkut.
    Recent shows the recently online friends on orkut. All others mean what they stand for.

  • grab what from [to] : Before you can start scrapping or do anything further, you must first build a database of friends or list of orkut id's. The Grab function is used to make the database. It takes two parameters and an optional third parameter:
    • what where: can take values [comm or community | flist or friendlist | wild ]

      comm or community : indicates that the list of friends is going to be grabbed from a community. In this case the from specifies a community id. (Community.aspx?cmm=ID)

      flist or friendlist: indicates that the list of friends is going to be from a friend's friends. In this case the from specifies the Orkut uid (FriendsList.aspx?uid=ID)

      wild : this is a combo of the above and grabs as much people specified by second parameter.

    • to : is an optional parameter that specifies the file to store the grabbed id's. If this parameter is left out, you will be asked to enter the file. If the file exists the new data is appended to the old file.


  • process uids : The grabbed ids by grab is not well formatted and may contain duplicates the process uids command formats the database and makes a final file. This command asks for the source file and makes a new destination file named by appending a .s extension to the original file. The formatted database is displayed.


  • scrap [filter] [source db] : is used to scrap multiple people. It takes 2 optional arguments.
    1. Filter : filters the source db according to the name. If skiped all persons in the database will be marked for scrapping.
    2. Source DB : The .s file that is required. If skiped you will be asked to enter location.


    > scrap just

    File to read : sample.id.s
    1 12312312313123123123 Just for keepin the communities
    Enter Friend # : 1
    Enter Scrap Text : hii \n how are you?
    Scrapping 1 12312312313123123123 [Just for keepin the communities]
    GET /Scrapbook.aspx?uid=12312312313123123123 [ OK ]
    POST scrap [FAILED] Retry (3)
    POST scrap [ OK ]
    Done.

    Enter Friend #: Takes a number or a format like X-X where X is a number. When X-X format is given all people between those two numbers will be marked for scrapping.

    Enter Scrap Text: The scrap text to be entered. To add new lines type \n and the scrap will have newlines when scrapped.

  • populate [Filter] [Source DB]: Same as scrap but this time its used to add the specified people as your friends.

  • captchaget : Just to read a Captcha and store the image as captcha.jpg



License
You are free to modify and edit by retaining a link or reference to this site.
There is no warranty what so ever. Any incidents of Orkut Banning you, or similar events shall not be my responsibility. Provided solely for education purpose. Any damage or inconvenience caused by the script is deeply regretted.
You have been warned.

Winding up...
I know this manual was too brief. I have tried as much to describe the Script. You will have confusions and doubts regarding the usage so please post your questions as a comment. I will be more than glad to answer them. If you really loved it or got it working or was helpful to you let me know. And dont forget to place a link to this page, if you are submitting to another site or forum.

Thanx Happy Orkutting...
:)

PS: If you noticed the Perl script colour coded, and like that check this out.

Thursday, June 14, 2007

Making Google talk Chat Themes

Intro

Making of a google talk chat theme is similar to making a 4 page HTML website with a CSS file. The following assumes you are using windows XP. Please unhide hidden files and folders.

The default chat themes for google talk are located in

X:\Documents and Settings\[Profile Name; Eg: Administrator.000]\Local Settings\Application Data\Google\Google Talk\themes\system\chat

where X: is the drive windows is installed.
[Profile Name] is your user name on windows.

Custom skins that we create must come under this folder:
X:\Documents and Settings\[Profile Name; Eg: Administrator.000]\Local Settings\Application Data\Google\Google Talk\themes\user\chat


Let us start creating a new skin name "digitalpbk"
Make a folder inside the above folder named "digitalpbk"

X:\Documents and Settings\[Profile Name; Eg: Administrator.000]\Local Settings\Application Data\Google\Google Talk\themes\user\chat\digitalpbk


Make a folder inside it named Content
Make one more folder inside Content named Resources

So the total path would look something like :
X:\Documents and Settings\[Profile Name; Eg: Administrator.000]\Local Settings\Application Data\Google\Google Talk\themes\user\chat\digitalpbk\Content\Resources


Make empty files and directories so that the complete Resources directory has :

Incoming \ Content.html
Incoming \ NextContent.html
Outgoing \ Content.html
Outgoing \ NextContent.html
main.css
status.html
nextstatus.html


File Descriptions

  • Incoming \ Content.html : When you chat to someone, their first reply will use the format specified in this file.

  • Incoming \ Content.html : When you chat to someone, their subsequent replies will use the format specified in this file.

  • Outgoing \ Content.html : When you chat to someone, your first message will use the format specified in this file.

  • Outgoing \ Content.html : When you chat to someone, your subsequent messages will use the format specified in this file.

  • main.css
  • : This is the main CSS sheet in which you specify the class of styles as you do for HTML.
  • Status.html : When you chat to someone, their status will use the format specified in this file.

  • NextStatus.html : When you chat to someone, their changes in status will use the format specified in this file.



Sample


This is a sample of the Chat skin i made. You can Download the Resources zip file. Contains the chat skin.

A lil documentation :)

main.css

Main.CSS is the main cascading style sheet, let us start styling with it.

BODY { color: #fff; background-color: #000; margin:4px; }
BODY a {text-decoration:none}
BODY a:link { color: #ccf; }
BODY a:hover { color: #ccf; text-decoration:underline;}
BODY a:active { color: #cfc; }
BODY a:visited { color: #ccf; }

DIV.send1st
{
background:url('bg.jpg');color:#fff;
}

DIV.recv1st
{
background:url('bg2.jpg');color:#fff;
}


send1st is the sending message format. Just an image simple.
Same for recv1st.

Enjoy making your skins and do let me know of yours
Feel free to comment....

Saturday, June 9, 2007

Buttons with Rollover Effect

Intro
In this article, I am going to explain how to make a simple link that looks like a button with roll over effects using only CSS.

First we have to decide on the dimensions of the image etc. And make an image that has the following format: The default image and then the rollover images.


The above image is 382x225 containing 3 images each of 382x75 stacked top to bottom.
The first image is the default image. The second is the hover image i.e., the image that is shown when the mouse is over the image. The third image is not used.

So we have to design the button
HTML:


<a href="http://www.answers.com/unicode%20mirror" class="ah"></a>
Styles:
a.ah
{
display:block;
width:382px;
height:75px;
background:url("http://www.blogger.com/img/bg-tab-right.gif") no-repeat 0 0;
}
a.ah:hover
{
background:url("http://www.blogger.com/img/bg-tab-right.gif") no-repeat 0 -75px;
}

The -75px highlited in red indicates the height of the images to be skipped, in this case 75px, If we have to display the third image as the hover image then just replace -150px here.

Demo:


For Starters ...

The Styles must be copied to the CSS file or pasted inside a
<style></style>
tags and the HTML can appear anywhere within the body.

Stuck?
Lemme know... Feel free to comment.

Thursday, June 7, 2007

Get anyones eMail ID on ORKUT

Intro

Yes you can get anyone's email ID who is on Orkut. This is a serious security hole and violates many privacy statements. You can actually get anyone's email ID on orkut.

How?


  • Goto the persons orkut Profile page.

  • Click the ignore user link.

  • Sign into Google Talk using the google talk client provided by google

  • Click on Settings near the top of the main google talk window.

  • On the list click Blocked

  • And there you will have the person's email ID





Thats all
I hope orkut fixes this soon. Otherwise many email ids are going to be compromised.

Sunday, June 3, 2007

CSS Transparency Effects

10%

20%

30%

40%

50%

60%

70%

80%

90%

100%


Intro
CSS (Cascading Style Sheets) can be used to add cool effects to an ordinary looking web page. One such example is adding transparency effect to images or other portions including text of your website.

in IE
In IE transparency is achieved by

 filter: alpha(opacity=XXX) 

where XXX takes value from 0 to 100. It indicates the % of opacity required.
For example
 <img src="http://www.google.com/intl/en_ALL/images/logo.gif" style="filter:alpha(opacity=50)" /> 

produces a semi transparent google logo.

in Firefox
In firefox the same effect is achieved by
 opacity:X
where X lies between 0 and 1 (0.1, 0.2,0.25 ...)
For example
 <img src="http://www.google.com/intl/en_ALL/images/logo.gif" style="opacity:0.5" /> 

produces a semi transparent google logo.

Inorder to produce the same effect on both browsers just give both codes
 <img src="http://www.google.com/intl/en_ALL/images/logo.gif" style="filter:alpha(opacity=50);opacity:0.5;" /> 

Both browsers would ignore the other code and produce the same effect.

Does this work on other browsers?
I donno try and let me know ....
Feel free to comment.