alias -l getwet {
var %fl $fline(@weather,*<b>Conditions</b>*,1)
echo -s first line %fl
var %ll $fline(@weather,*<td>Clouds <br>*,1)
echo -s last line %ll
window @weather_2
echo -s opening window @weather_2
echo -s Attempting to copy lines %fl to %ll
filter -wwcr %f1 $+ - $+ %ll @weather @weather_2
echo -s Lines %fl to %ll copied to @weather_2
window -c @weather
echo -s Window @weather closed ... Attempting to strip HTML
var %cl $line(@weather_2,0)
var %tl
echo -s opening @weather_3 for stripped data
window @weather_3
echo -s opened, beginning strip
while %cl < %tl {
aline @weather_3 $striphtml($line(@weather,%cl))
dec %cl
}
echo -s Finished Stripping
}
alias striphtml {
var %return, %regex = $regsub($1-,/(^[^>]*>|<[^>]*>|<[^<]*$)/g,$null,%return)
return $iif($remove(%return,$chr(9),&nbsp;) != $null,$remove(%return,$chr(9),&nbsp;),$chr(42) $+ $chr(42) $+ $chr(42))
}