Excellent work,
But maybe you can add some weather textinfo though. If you decide to do so, you can use the code below to get the ICAO info from an airport close to your house. I fetched this info with Net::FTP, (which is a little bit faster I believe?) but LWP::Simple works just as good.
#!/usr/bin/perl -w
use strict;
use LWP::Simple;
use HTTP::Request;
#Name your city, village, carton box
my $city = "My City";
#Text to appear in above weatherreport
my $wthrtext = "Current Weather in $city:";
# Your very own ICAO location. See http://weather.noaa.gov for more i
+nfo...
my $weathericao = "EHAM.TXT";
# Create yer user agent object
use LWP::UserAgent;
my $ua = new LWP::UserAgent;
$ua->agent( "WeatherBot " . $ua->agent );
# Add your request ;)
my $req =
HTTP::Request->new( GET =>
"ftp://weather.noaa.gov/data/observations/metar/decoded/$weather
+icao" );
$req->header( Accept => "text/html, */*;q=0.1" );
# Now pass that request to the user agent and get a response back
my $res = $ua->request($req);
# Check the outcome of the response
if ( $res->is_success ) {
print "Fetched weather...\n\n";
}
else {
print "Nope, couldn't fetch weather...\n";
exit;
}
my $weather = $res->content;
#Bring on the sunshine!
print "$wthrtext\n\n$weather";
Aaaah, Sunshine ;)
Teabag
Sure there's more than one way, but one just needs one anyway - Teabag
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Outside of code tags, you may need to use entities for some characters:
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|