Utilisateur:KelBot/kbget
Apparence
<syntaxhighlight lang="perl">
- !/usr/bin/perl
use KelBot;
use strict;
use Getopt::Long;
my $pw;
my $page;
GetOptions('page=s' => \$page);
if ($page) {
kbget($page);
} else {
unless ($page) {
while ($page = <STDIN>) { $page =~ s/\n//; kbget($page); }
}
}
sub kbget {
my $page = shift; return unless ($page);
unless ($pw) {
$pw = KelBot->new('kbget');
} $page = `php -q ./urlencode.php "$page"`; print $pw->get_text($page)."\n";
}