This shows you the differences between two versions of the page.
dl-xml-example [2009/05/10 17:14] jay |
dl-xml-example [2009/05/11 21:30] (current) jay |
||
---|---|---|---|
Line 23: | Line 23: | ||
<phone/> | <phone/> | ||
<fax/> | <fax/> | ||
+ | <label>Montreal</label> | ||
</location> | </location> | ||
<location> | <location> | ||
Line 36: | Line 37: | ||
<phone>(541) 338-2234</phone> | <phone>(541) 338-2234</phone> | ||
<fax/> | <fax/> | ||
+ | <label>Main Office</label> | ||
</location> | </location> | ||
...etc... | ...etc... | ||
Line 52: | Line 54: | ||
use XML::Simple; | use XML::Simple; | ||
- | my $params='?country=30'; | + | my $params='?country=30'; # for testing, we'll look for dealers in canada |
- | my $baseurl='http://sandbox.purplewire.com/~jay/adminv4/DealerLocator/'; | + | my $baseurl='http://<your channelsuite URL>/API/DealerLocator/xml.cgi'; |
my $agent = LWP::UserAgent->new(env_proxy => 1,keep_alive => 1, timeout => 30); | my $agent = LWP::UserAgent->new(env_proxy => 1,keep_alive => 1, timeout => 30); | ||
- | my $url = $baseurl."/DealerLocatorWS.cgi".$params; # a GET URL string | + | my $url = $baseurl.$params; # a GET URL string |
my $header = HTTP::Request->new(GET => $url); | my $header = HTTP::Request->new(GET => $url); | ||
my $request = HTTP::Request->new('GET', $url, $header); | my $request = HTTP::Request->new('GET', $url, $header); |