#!/usr/bin/env perl
# Author: su - <www.solocodigo.com>
# http://www.solocodigo.com
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# Version 2, December 2004
#
# Copyright (C) 2004 Sam Hocevar
# 22 rue de Plaisance, 75014 Paris, France
# Everyone is permitted to copy and distribute verbatim or modified
# copies of this license document, and changing it is allowed as long
# as the name is changed.
#
# DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
# TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
#
# 0. You just DO WHAT THE FUCK YOU WANT TO.
use LWP::RobotUA;
use strict; # Pragma usado para limitar los bugs que puedan existir
use Getopt::Long; # Extended processing of command line options.
use HTLM::Forms;
sub usar {
print "Como usar $0 :\n\t-query palabra: Palabra a buscar\n\t-link link: link\n";
exit;
}
my $query;
my $link;
GetOptions ('query=s' => \$query, 'link=s' \$link);
die usar() unless defined $link and defined $query;
my $browser = LWP::RobotUA->new('su-robot/0.1');
$browser->delay(30/60); #Regla para robot, llama al servidor en un tiempo determinado
my $test = 0;
my $respuesta = $browser->get($link);
if ($response->is_success){
my @forms = HTML::Form->parse($response);
print "Aqui haces algo con cada forms\n";
print "Mira la documentacion de HTML::Form para ver bien como se usa\n";
}
else {
die $response->status_line;
}
###############################################
# This program is free software. It comes without any warranty, to
# the extent permitted by applicable law. You can redistribute it
# and/or modify it under the terms of the Do What The Fuck You Want
# To Public License, Version 2, as published by Sam Hocevar. See
# http://sam.zoy.org/wtfpl/COPYING for more details.