NAME
LWP::Curl - LWP methods implementation with Curl engine
VERSION
Version 0.01
SYNOPSIS
Implementa a interface do LWP no modulo WWW::Curl::Easy para que as pessoas que estao acostumadas como LWP não sofram com o Curl e usem ele transparentemente
use LWP::Curl;
my $lwpcurl = LWP::Curl->new();
my $content = $lwpcurl->get('http://search.cpan.org','http://www.cpan.org'); # get the page http://search.cpan.org passing with referer http://www.cpan.org
Constructor
new()
Creates and returns a new LWP::Curl object, hereafter referred to as the "lwpcurl".
my $lwpcurl = LWP::Curl->new()
timeout => sec
Set the timeout value in seconds. The default timeout value is 180 seconds, i.e. 3 minutes.
headers => [0|1]
Show HTTP headers when return a content. The default is false '0'
user_agent => 'agent86'
Set the user agent string. The default is 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)'
followlocation => [0|1]
If the spider receive a HTTP 301 ( Redirect ) they will follow?. The default is 1.
maxredirs => number
Set how deep the spider will follow when receive HTTP 301 ( Redirect ). The default is 3.
METHODS
$curl->get($url,$referer)
Get content of $url, passando $referer se definido
$curl->timeout($sec)
Set timeout, default 180
$curl->agent_alias($alias)
Copy from L<WWW::Mechanize> begin here
____________________________________
Sets the user agent string to the expanded version from a table of actual user strings.
I<$alias> can be one of the following:
Windows IE 6
Windows Mozilla
Mac Safari
Mac Mozilla
Linux Mozilla
Linux Konqueror
then it will be replaced with a more interesting one. For instance,
____________________________________
Copy from L<WWW::Mechanize> ends here, but the idea and the data structure is a copy too :)
$curl->agent_alias( 'Windows IE 6' );
sets your User-Agent to
Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)
TODO
This is a small list of features I plan to add. Feel free to contribute with your wishlist and comentaries!
POST method, this i will release soon.
Improve the Documentation and tests
Support Cookies
Support Proxys
PASS in all tests of LWP
Make a patch to WWW::Mechanize, todo change engine, like "new(engine => 'LWP::Curl')"
AUTHOR
Lindolfo Rodrigues de Oliveira Neto, <lorn at cpan.org>
BUGS
Please report any bugs or feature requests to bug-lwp-curl at rt.cpan.org
, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=LWP-Curl. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
SUPPORT
You can find documentation for this module with the perldoc command.
perldoc LWP::Curl
You can also look for information at:
RT: CPAN's request tracker
AnnoCPAN: Annotated CPAN documentation
CPAN Ratings
Search CPAN
ACKNOWLEDGEMENTS
Thanks to Breno G. Oliveira for the great tips.
COPYRIGHT & LICENSE
Copyright 2008 Lindolfo Rodrigues de Oliveira Neto, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
1 POD Error
The following errors were encountered while parsing the POD:
- Around line 24:
Non-ASCII character seen before =encoding in 'não'. Assuming UTF-8