Edoceo::UserAgent is a wrapper package for LWP::UserAgent and a few others. When first using LWP information was difficult to find for a complete UserAgent framework. Looking for a package that was smart enough to handle a session, cookies and other full scale UA features was difficult. This framework is provided to help others, it surely needs to be customized for the readers environment. Assistance with PERL development is also available, for a fee, please use our contact form.
UserAgent is extremely easy to use, simply do this the package will do everything.
#!/usr/bin/perl use strict; use Edoceo::UserAgent; my $url = 'http://www.edoceo.com/contact.php'; my $ua = Edoceo::UserAgent->new(); # This is a standard LWP HTTP Response my $res = $ua->get($url); # $res = $ua->post($url,$post_data); # $res = $ua->file($url,$file_data); # Returns an array of HTTP::Form objects, if any present in last response # undef if no response or no forms my @forms = $ua->forms(); print $forms->dump; #$ua->save_cookies($file_name); #$ua->load_cookies($file_name); # Oh yea, view the content or give to HTML::Parser print $res->content;
This can be saved into the @INC path, a recommended location is like /usr/lib/perl5/site_perl/Edoceo/UserAgent.pm, choose wisely. Gentoo Linux allows for /etc/perl/Edoceo/UserAgent.pm, Gentoo is good.
Edoceo::UserAgent need the following packages to run