Create a gist now

Instantly share code, notes, and snippets.

@VR2ZDX /wx.pl Secret
Created Aug 9, 2016

#!/usr/bin/perl
use strict;
use warnings;
use LWP::Simple;
# Variables for temperature, humidity, wind direction, speed, gust and pressure
my $temperature;
my $humidity;
my $winddirection;
my $windspeed;
my $windgust;
my $pressure;
# RegEx match count
my $count;
# Convert month into 2 digit format
my $month = sprintf("%02d", ((localtime)[4] + 1) % 100);
# Convert day into 2 digit format
my $day = sprintf("%02d", (localtime)[3] % 100);
# Convert hour into 2 digit format
my $hour = sprintf("%02d", (localtime)[2] % 100);
# Convert minute into 2 digit format
my $minute = sprintf("%02d", (localtime)[1] % 100);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment