Skip to content

Instantly share code, notes, and snippets.

@VR2ZDX

VR2ZDX/wx.pl Secret

Created August 9, 2016 03:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save VR2ZDX/9837cd25313f5265565199eca1da3201 to your computer and use it in GitHub Desktop.
Save VR2ZDX/9837cd25313f5265565199eca1da3201 to your computer and use it in GitHub Desktop.
#!/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