If you want to use that script, you don't need to wait for the next build.
This assumes that you have PHP on your local web server.
Source:
Code: Select all
<?php
############################################################################
# A Project of TNET Services, Inc.
############################################################################
#
# Project: Cumulus Project
# Module: WXNOW.php
# Purpose: WXNOW Auto generated Page
# Authors: Kevin W. Reed <kreed@tnet.com>
# TNET Services, Inc.
#
# Copyright (c) 1992-2008 Copyright TNET Services, Inc.
############################################################################
# This document uses Tab 4 Settings
############################################################################
#
# License:
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
# USA.
#
############################################################################
# HISTORY
############################################################################
#
# 0.1 Beta
#
############################################################################
# HTACCESS SETTINGS
############################################################################
# If you want the script to respond to a request from a url like
#
# http://YOUR_SERVER/WXNOW.txt
#
# You can add the following to the .htaccess file in your Apache Web
# Server to have it do that.
#
# RewriteEngine On
# RewriteRule ^/?wxnow.txt$ /WXNOW.php [L]
# RewriteRule ^/?WXNOW.txt$ /WXNOW.php [L]
#
############################################################################
# FORMAT OF Variation 4 (Weather Link) HTM File
############################################################################
#
# Jun 01 2003 08:07
# 272/000g006t069r010p030P020h61b10150
# ***********************************************************
#
# 272 - wind direction - 272 degrees
# 010 - wind speed - 10 mph
#
# g015 - wind gust - 15 mph
# t069 - temperature - 69 degrees F
# r010 - rain in last hour in hundredths of an inch - 0.1 inches
# p030 - rain in last 24 hours in hundredths of an inch - 0.3 inches
# P020 - rain since midnight in hundredths of an inch - 0.2 inches
# h61 - humidity 61% (00 = 100%)
# b10153 - barometric pressure in tenths of a millibar - 1015.3 millibars
############################################################################
# Format of File
# Date DD/MM/YY (we convert it to YYYY-MM-DD
# Time
# Temp float
# Humidity int
# Dewpt float
# wind speed int
# wind gust int
# Bearing compass
# rain rate float
# rain today float
# Pressure float
# Windir label
# Wind Speed float
# Wind Unit label
############################################################################
$months = array( "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep",
"Oct", "Nov", "Dec" );
// Change to match path to realtime.txt file
// Should be the only thing you need to change if your realtime.txt
// is NOT located in the same location as this script
$input = file("./realtime.txt");
$vars = preg_split('/ /', $input[0]);
$day = substr($vars[0],0,2);
$month = $months[ substr($vars[0],3,2) -1 ];
$year = "20" . substr($vars[0],6,2) ;
$hour = substr($vars[1],0,2);
$min = substr($vars[1],3,2);
echo $month . ' ' . $day . ' ' . $year . ' ' . $hour . ':' . $min . PHP_EOL;
echo sprintf("%03d/%03d", $vars[7], intval($vars[5]) );
echo sprintf("g%03d", $vars[6]);
echo sprintf("t%03d", intval($vars[2]) ) ;
echo sprintf("P%03d", intval($vars[9] * 10));
$hum = intval($vars[3]);
if ($hum == 100) {
$hum == 00;
}
echo sprintf("h%02d",$hum);
echo sprintf("b%05d", intval($vars[10] * 10) );
echo PHP_EOL;
############################################################################
# END OF SCRIPT
############################################################################