#!/usr/bin/perl

$msg=$ARGV[0]; $rain="No"; $max=" "; $min=" ";
	$msg=~s/\s{2,100}/ /g; $msg=~s/ o.clock/:00/g; $msg=~s/midnight/0:00/gi; $msg=~s/noon/12:00/gi;
	if($msg=~/we have (.+)? and (\d+) degrees/i){ $lab=$1; $deg=$2; }
	if($lab!~/\S/ and $msg=~/(\d+) degrees, ([^,]+), /){ $deg=$1; $lab=$2; }
	$max=$1 if($msg=~/maximum temperature will be (\d+) degrees/i);
	$min=$1 if($msg=~/minimum temperature will be (\d+) degrees/i);
	$rain="<b>YES</b>" if($msg=~/\brain\b/i and $msg!~/\bno rain\b/i);
	$tim=$1 if($msg=~/, at about (\d+:\d+)\D/i);
	$tim="0$tim" if($tim=~/^\d:\d\d\b/);
	print "$lab;$deg;$max;$min;$tim;$rain";
