9 our $PROGRAM_DIR = $ENV{XR_PERL_SOURCE_DIR
};
10 unless($PROGRAM_DIR) {
12 $PROGRAM_DIR =~ s/[^\/\\]+$//;
13 $PROGRAM_DIR =~ s/\/+$//;
14 $PROGRAM_DIR = "." unless($PROGRAM_DIR);
17 map "$PROGRAM_DIR/$_",qw{modules lib
../modules
..lib
};
21 my @OPTIONS = qw
/help|h|? version|ver edit-me manual|man/;
26 require MyPlace
::Usage
;
27 Getopt
::Long
::GetOptions
(\
%OPTS,@OPTIONS);
28 MyPlace
::Usage
::Process
(\
%OPTS,$VERSION);
31 my($user,$pass) = @ARGV;
33 print STDERR
"Login Id:";
34 $user= readline(*STDIN
);
36 die("Invalid Login Id") unless($user);
39 print STDERR
"Password:";
40 $pass= readline(*STDIN
);
42 die("Invalid password") unless($pass);
45 my $sina = MyPlace
::Sina
->new();
46 print STDERR
"[$user] Logining into sina.com.cn ...\n";
47 my ($ex,$data) = $sina->login($user,$pass,"http://t.sina.com.cn");
48 if($data =~ m/"result":true/) {
49 print STDERR
"[OK]\n";
53 print STDERR
"[Failed]\n";
64 sina.login - PERL script
68 sina.login [options] ...
76 Print version infomation.
80 Print a brief help message and exits.
82 =item B<--manual>,B<--man>
84 View application manual
88 Invoke 'editor' against the source
98 2010-11-09 22:39 xiaoranzzz <xiaoranzzz@myplace.hell>
104 xiaoranzzz <xiaoranzzz@myplace.hell>