M
Mahaan
Hello,
I am trying to enter a HTTPS site -- Google Answers, for example. I
found this simple Google Answers client at Google Answers
(http://answers.google.com/answers/threadview?id=28442).
Here's the code:
++++++++++++ Begin Code ++++++++++++
use LWP;
use HTTP::Request::Common;
use HTTP::Cookies;
$email='(e-mail address removed)';
$pass='ottffss';
$ua = LWP::UserAgent->new;
$ua->cookie_jar(HTTP::Cookies->new);
$req=$ua->request(POST
'https://answers.google.com/answers/main?cmd=login', ['email'=>$email,
password=>$pass, 'submit'=>'Login']);
if ($req->content=~ /Invalid login/){
print "invalid login!\n";
}else{
print "welcome to google answers \n";
$req=$ua->request(GET
'https://answers.google.com/answers/main?cmd=myinvoices');
print $req->content;
$req->content=~/<td> Current Earnings \(what you will be paid\)
for Answering Questions: <\/td> <td width="1%">
\$([0-9]+(?:.[0-9]+)?)/;
$ear=$1;
$req->content=~/<td> Current Balance \(what you will be charged\)
for Asked Questions: <\/td> <td width="1%"> \$([0-9]+(?:.[0-9]+)?)/;
$char=$1;
print "Will be paid: $ear \nWill be charged: $char\n";
}
++++++++++++ End Code ++++++++++++
Every time I run the code, I get a "400 URL missing" error.
Any help would be appreciated.
Thanks.
I am trying to enter a HTTPS site -- Google Answers, for example. I
found this simple Google Answers client at Google Answers
(http://answers.google.com/answers/threadview?id=28442).
Here's the code:
++++++++++++ Begin Code ++++++++++++
use LWP;
use HTTP::Request::Common;
use HTTP::Cookies;
$email='(e-mail address removed)';
$pass='ottffss';
$ua = LWP::UserAgent->new;
$ua->cookie_jar(HTTP::Cookies->new);
$req=$ua->request(POST
'https://answers.google.com/answers/main?cmd=login', ['email'=>$email,
password=>$pass, 'submit'=>'Login']);
if ($req->content=~ /Invalid login/){
print "invalid login!\n";
}else{
print "welcome to google answers \n";
$req=$ua->request(GET
'https://answers.google.com/answers/main?cmd=myinvoices');
print $req->content;
$req->content=~/<td> Current Earnings \(what you will be paid\)
for Answering Questions: <\/td> <td width="1%">
\$([0-9]+(?:.[0-9]+)?)/;
$ear=$1;
$req->content=~/<td> Current Balance \(what you will be charged\)
for Asked Questions: <\/td> <td width="1%"> \$([0-9]+(?:.[0-9]+)?)/;
$char=$1;
print "Will be paid: $ear \nWill be charged: $char\n";
}
++++++++++++ End Code ++++++++++++
Every time I run the code, I get a "400 URL missing" error.
Any help would be appreciated.
Thanks.