Programming 1 - WeChall

#!/usr/bin/perl

use strict;
use warnings;
use v5.14.2;
use LWP::UserAgent;
use HTTP::Cookies;
use CGI;
use WWW::Mechanize;
use HTML::TokeParser;
use HTML::TreeBuilder;
use File::Temp;
use URI::file;
use WWW::Mechanize::TreeBuilder;
use HTML::Parser;
use HTML::TagParser;
use Math::Round;
use POSIX qw/floor/;


my $browser = LWP::UserAgent->new;
$browser->default_header('cookie','WC=8435090-12918-Zru0JIKhb4ohrqvO');

my $req = HTTP::Request->new(GET => 'http://www.wechall.net/challenge/training/programming1/index.php?action=request');
my $res = $browser->request($req);

print $res->content;
my $risultato=$res->content;


my $browser2 = LWP::UserAgent->new;
$browser2->default_header('cookie','WC=8435090-12918-Zru0JIKhb4ohrqvO');

my $req2 = HTTP::Request->new(GET => 'http://www.wechall.net/challenge/training/programming1/index.php?answer='.$risultato);
my $res2 = $browser2->request($req2);

print $res2->content;


Categories: Share

Leave a Reply