3 # SUO PELMEN auto-record script
4 # Copyright 2012, David Veliev (gotoindvdum@gmail.com).
5 # This program may be used under Apache License 2.0.
11 $ENV{'PERL_LWP_SSL_VERIFY_HOSTNAME'} = 0;
14 my $date = sprintf("%04d-%02d-%02d %02d:%02d:%02d", $tm->year + 1900, $tm->mon + 1, $tm->mday, $tm->hour, $tm->min, $tm->sec);
16 # Create a user agent object
17 my $ua = LWP::UserAgent->new;
18 #$ua->agent("MyApp/0.1 ");
21 my $req = HTTP::Request->new(POST => 'https://office.alphatech.ru/suo-pelmen/subscribe');
22 $req->content_type('application/x-www-form-urlencoded');
23 $req->content('users=52');
25 # Pass request to the user agent and get a response back
26 my $res = $ua->request($req);
28 # Check the outcome of the response
29 if ($res->is_success) {
30 print $date, " SUCCESS:\n", $res->content, "\n\n";
33 print $date, " FAIL:\n", $res->status_line, "\n\n";