Un simple buscador de sueños en Perl.
#!usr/bin/perl
#Buscador de sueños 0.1
#Coded By Doddy H
use LWP::UserAgent;
my $nave = LWP::UserAgent->new;
$nave->agent(
"Mozilla/5.0 (Windows; U; Windows NT 5.1; nl; rv:1.8.1.12) Gecko/20080201Firefox/2.0.0.12"
);
$nave->timeout(5);
header();
print "\n[+] Palabra : ";
chomp( my $string = <stdin> );
my $code =
toma( "http://www.mis-suenos.org/interpretaciones/buscar?text=" . $string );
if ( $code =~ /<li>(.*)<\/li>/ ) {
my $si = $1;
if ( $si eq " " ) {
print "\n\n[-] No se encontro\n";
}
else {
print "\n\n[+] Significado : $si\n";
}
}
copyright();
sub header {
print "\n\n-- == Buscador de sueños == --\n\n";
}
sub copyright {
print "\n\n(C) Doddy Hackman 2012\n\n";
<stdin>;
exit(1);
}
sub toma {
return $nave->get( $_[0] )->content;
}
#The End ?