in reply to AIM-Bot help again, please!
Observation: Your basic problem is how to parse the XML data and get the desired value for a given tag.
Pointer:You can use Bundle::XML
Code:
Few Liner:use strict; use warnings; use LWP::Simple; use XML::Simple; my $zipcode = '03054'; my $site1 = get 'http://beta1.accuweather.com/beta1/dtwx_initialize.a +sp?zipcode='.$zipcode; my $DTWXSetup = XMLin($site1); my $Location = $DTWXSetup->{Location}; my $UFDB = $Location->{UFDB}; my $site2 = get 'http://beta1.accuweather.com/beta1/dtwx_curcon.asp?u +fdb='.$UFDB; my $CurrentConditions = XMLin($site2); my $Temperature = $CurrentConditions->{Temperature}; print "ZIP:$zipcode\nTemperature:$Temperature\n"; XMLout();
Point: I wish that you will make a point to learn more XML, from sites like XML Perl.use LWP::Simple; use XML::Simple; my $zipcode = shift; print XMLin(get 'http://beta1.accuweather.com/beta1/dtwx_curcon.asp?uf +db='. XMLin(get 'http://beta1.accuweather.com/beta1/dtwx_initiali +ze.asp?zipcode='.$zipcode)->{Location}->{UFDB})->{Temperature};
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: AIM-Bot help again, please!
by Sleepaholic88 (Novice) on Mar 22, 2003 at 05:35 UTC | |
by cfreak (Chaplain) on Mar 22, 2003 at 22:32 UTC | |
|
Re: Re: AIM-Bot help again, please!
by Sleepaholic88 (Novice) on Mar 24, 2003 at 18:13 UTC |