Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Checking the Weather

by bfdi533 (Friar)
on Mar 21, 2006 at 17:31 UTC ( [id://538237]=note: print w/replies, xml ) Need Help??


in reply to Checking the Weather

You can also use Net::Telnet to check the weather from wunderground.com (they have a telnet interface which is all text). Here is the example from the Net::Telnet documentation which does just that:

my ($forecast, $t); use Net::Telnet (); $t = new Net::Telnet; $t->open("rainmaker.wunderground.com"); ## Wait for first prompt and "hit return". $t->waitfor('/continue:.*$/'); $t->print(""); ## Wait for second prompt and respond with city code. $t->waitfor('/city code.*$/'); $t->print("BRD"); ## Read and print the first page of forecast. ($forecast) = $t->waitfor('/[ \t]+press return to continue/i'); print $forecast; exit;

The only problem with this telnet interface is that they do not have Tupper Lake, NY as a location you can get info on. They have several location throughout NY that may or may not be nearby.

Update: Fixed a copy/paste error in the code segment above.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://538237]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (3)
As of 2025-07-13 14:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.