All pastes #667667 Raw Edit

Miscellany

public php v1 · immutable
#667667 ·published 2007-08-23 06:39 UTC
rendered paste body
preg_match('/<s>(.+)<\/s>/',$page, $windz);    if(preg_match_all('/<\/d>\s*<t>(.+)<\/t>\s*<\/wind>/s',$page, $windd)) {	$winddir = $windd[1];	 switch($winddir) {	 CASE 'N':	 return 'North';	 CASE 'S':	 return 'South';	 CASE 'E':	 return 'East';	 CASE 'W':	 return 'West';	 CASE 'SW':	 return 'Southwest';	 CASE 'SE':	 return 'Southeast';	 CASE 'NW':	 return 'Northwest';	 CASE 'NE':	 return 'Northeast';	 CASE 'SSW':	 return 'South-Southwest';	 CASE 'SSE':	 return 'South-Southeast';	 CASE 'NNW':	 return 'North-Northwest';	 CASE 'NNE':	 return 'North-Northeast';	 CASE 'WNW':	 return 'West-Northwest';	 CASE 'WSW':	 return 'West-Southwest';	 CASE 'ENE':	 return 'East-Northeast';	 CASE 'ESE':	 return 'East-Southeast';	 }	 if($windz[1] != 'calm') { $wind = "$winddir[1][0] at $windz[1] MPH"; }	 else { $wind = 'calm'; }	 }    preg_match('/<hmid>(.+)<\/hmid>/',$page, $hmid);	preg_match('/<ud>.<i>(.+)<\/i>.<t>(.+)<\/t>.<\/uv>/',$page, $uv);	preg_match('/<r>(.+)<\/r>/',$page, $r);	preg_match('/<d>(.+)<\/d>/',$page, $d);	if($uv[1] > 2) { $uvi = ", UV Index: $uv[1] ($uv[2])"; }	else { unset($uv); }