S
Some Guy
I'm trying to use HTTP::Request::Common, and can't get it to work.
Specifically, I'm trying to use it on
http://www.geocaching.com/seek/nearest.aspx?zip=asdf&dist=100 to get
geocaches by zipcode, using the following:
------------------------------------------
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common;
my $action = POST 'http://www.geocaching.com/seek/nearest.aspx?zip=asdf&dist=100',
[
'DropDownTaxonomy' => '9a79e6ce-3344-409c-bbe9-496530baf758',
'LocationPanel1:ddSearchType' => 'ZIP',
'LocationPanel1:OriginText' => '90210'
];
$action->header( 'User-Agent' => 'Mozilla/5.0' );
my $ua = LWP::UserAgent->new;
my $request = $ua->request( $action );
$request->is_success or die $request->status_line;
my $content = $request->content;
my $file = "tmp.txt";
open(FILE, ">$file") or die "Error opening file";
print FILE $content;
close(FILE);
Specifically, I'm trying to use it on
http://www.geocaching.com/seek/nearest.aspx?zip=asdf&dist=100 to get
geocaches by zipcode, using the following:
------------------------------------------
use strict;
use warnings;
use LWP::UserAgent;
use HTTP::Request::Common;
my $action = POST 'http://www.geocaching.com/seek/nearest.aspx?zip=asdf&dist=100',
[
'DropDownTaxonomy' => '9a79e6ce-3344-409c-bbe9-496530baf758',
'LocationPanel1:ddSearchType' => 'ZIP',
'LocationPanel1:OriginText' => '90210'
];
$action->header( 'User-Agent' => 'Mozilla/5.0' );
my $ua = LWP::UserAgent->new;
my $request = $ua->request( $action );
$request->is_success or die $request->status_line;
my $content = $request->content;
my $file = "tmp.txt";
open(FILE, ">$file") or die "Error opening file";
print FILE $content;
close(FILE);