Hello, there!
I am trying to connect into ShareIt system. I need to refresh my sales information automatically. I know LWP is power to help me, but I try and get nothing positive yet.
What I am doing:
#!/usr/bin/perl
use LWP::UserAgent; use LWP::Simple; use HTTP::Request::Common qw(POST); use strict; use warnings;
print "Content-type: text/html; charset=windows-1251\n\n";
$|++;
my $cont = get("https://secure.shareit.com/shareit/cp/login/index.html");
my ($uri, $sessid, $random);
if ($cont =~ /.*=(\d+)&.*=(\w+)"/g) { $uri = "https://secure.shareit.com/shareit/cp/login/index.html?sessionid=$1&random=$2"; ($sessid, $random) = ($1, $2); }
my $ua = LWP::UserAgent->new(); $ua->agent("Superzilla/v4.11 Platinum"); my $req = POST $uri, [PUBLISHER_ID => "mylogin", PASSWORD => "password"];
$cont = $ua->request($req)->as_string; print $cont;
exit();
When I make POST and print then the variable $cont I get the login page again. Where is a mistake?
Thank you in advance.
Nicolay A. Vasiliev