WWW::Pastebin::Many::Retrieve - retrieve pastes from many different pastebin sites
use strict; use warnings; use WWW::Pastebin::Many::Retrieve; my $paster = WWW::Pastebin::Many::Retrieve->new; my @pastes = qw( http://pastebin.ca/963177 http://pastebin.com/d2fbd2737 http://www.nomorepasting.com/getpaste.php?pasteid=10124 http://pastie.caboo.se/172741 http://phpfi.com/302683 http://rafb.net/p/XU5KMo65.html http://paste.ubuntu-nl.org/61578/ ); for ( @pastes ) { print "Processing paste $_\n"; $paster->retrieve( $_ ) or warn $paster->error and next; print "Content on $_ is:\n$paster\n"; }
The module provides interface to retrieve pastes from several pastebins (see "SUPPORTED PASTEBINS" section) using a single method by giving it URI to the paste.
new
my $paster = WWW::Pastebin::Many::Retrieve->new; my $paster = WWW::Pastebin::Many::Retrieve->new( timeout => 20 );
Constructs and returns a new WWW::Pastebin::Many::Retrieve object. Takes one argument which is optional:
timeout
my $paster = WWW::Pastebin::Many::Retrieve->new( timeout => 20 );
Optional. Specifies the timeout in seconds this will be passed into constructors for all the pastebin retrieving modules used under the hood. See "SUPPORTED PASTEBINS" section below. Defaults to: whatever the default is for particular pastebin retrieving module; usually it is 30 seconds.
30
retrieve
my $response = $paster->retrieve('http://uri_to_some_paste/') or die $paster->error;
Instructs the object to retrieve certain paste. Takes one mandatory argument which must be the URI pointing to the paste on one of the supported pastebin sites (see "SUPPORTED PASTEBINS" section). The return value on success will be what the return from retrieve() method of a particular pastebin retrieving module would return; this is differs enough to be useless thus use the content() method (see below) to obtain the content of the paste. On failure returns either undef or an empty list and the reason for failure will be available via error() method.
retrieve()
content()
undef
error()
error
Takes no arguments, returns a human parsable message explaining why the call to retrieve() method failed.
response
my $last_response = $paster->response;
Must be called after a successful call to retrieve(). Takes no arguments, returns the exact same thing last call to retrieve() returned.
content
my $paste_content = $paster->content; print "Paste content is: $paster\n";
Must be called after a successful call to retrieve(). Takes no arguments, returns the content of the paste you retrived. This method is also overloaded as q|""| thus you can simply interpolate your object in a string to obtain the content of the paste.
q|""|
Note: this module no longer supports http://paste.css-standards.org/ pastebin as the site no longer exists.
Currently the module is able to retrieve pastes from the following pastebins:
Handled by WWW::Pastebin::PastebinCa::Retrieve
Handled by WWW::Pastebin::PastebinCom::Retrieve
Handled by WWW::Pastebin::NoMorePastingCom::Retrieve
Handled by WWW::Pastebin::PastieCabooSe::Retrieve
Handled by WWW::Pastebin::PhpfiCom::Retrieve
Handled by WWW::Pastebin::RafbNet::Retrieve
Handled by WWW::Pastebin::UbuntuNlOrg::Retrieve
Zoffix Znet, <zoffix at cpan.org> (http://zoffix.com, http://haslayout.net)
<zoffix at cpan.org>
Please report any bugs or feature requests to bug-www-pastebin-many-retrieve at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WWW-Pastebin-Many-Retrieve. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-www-pastebin-many-retrieve at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc WWW::Pastebin::Many::Retrieve
You can also look for information at:
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=WWW-Pastebin-Many-Retrieve
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/WWW-Pastebin-Many-Retrieve
CPAN Ratings
http://cpanratings.perl.org/d/WWW-Pastebin-Many-Retrieve
Search CPAN
http://search.cpan.org/dist/WWW-Pastebin-Many-Retrieve
Copyright 2008 Zoffix Znet, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install WWW::Pastebin::Many::Retrieve, copy and paste the appropriate command in to your terminal.
cpanm
cpanm WWW::Pastebin::Many::Retrieve
CPAN shell
perl -MCPAN -e shell install WWW::Pastebin::Many::Retrieve
For more information on module installation, please visit the detailed CPAN module installation guide.