submit a url
aldo (aldo@racesearch.com)
Tue, 13 Apr 1999 12:28:00 -0700
This is a multi-part message in MIME format.
------=_NextPart_000_003F_01BE85A9.1182BAE0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi ...
I am working on a script to submit a url automatically to the search =
engines.
Would this kind of script works ? What modules do I need to get ?
Thanks.
# Create a user agent object
use LWP::UserAgent;
$ua =3D new LWP::UserAgent;
$ua->agent("AgentName/0.1 " . $ua->agent);
# Create a request
my $req =3D new HTTP::Request POST =3D> 'http://www.racesearch.com';
$req->content_type('application/x-www-form-urlencoded');
$req->content('field1=3Dvalue1&act=3Dsubmit');
# Pass request to the user agent and get a response back
my $res =3D $ua->request($req);
# Check the outcome of the response
if ($res->is_success) {
print $res->content;
} else {
print "fail\n";
}
------=_NextPart_000_003F_01BE85A9.1182BAE0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN">
Hi ...
I am working =
on a script to=20
submit a url automatically to the search engines.
Would this kind of script works ? What modules do I =
need to=20
get ?
Thanks.
# Create a user =
agent=20
object
use LWP::UserAgent;
$ua =3D new=20
LWP::UserAgent;
$ua->agent("AgentName/0.1 " .=20
$ua->agent);
# =
Create a request
my $req =3D new HTTP::Request=
POST =3D> 'http://www.racesearch.com';
$req->content_type('application/x-www-form-urlencoded');
$req->content('field1=3Dvalue1&act=3Dsubmit');
# =
Pass request to the user agent and get a response back
my $res =3D $ua->request($req);
# =
Check the outcome of the response
if ($res->is_success) {
print $res->content;
} else {
print "fail\n";
}
------=_NextPart_000_003F_01BE85A9.1182BAE0--