ECS-L Home Automation and Security Archives
  learn more | view messages for this month | NetBloc® | terms of use | search

Google
 


  subject (prev) or (next) | time (prev) or (next) | author (prev) or (next) | view more subjects

Subject:
From:
Date:
RE: [ECS] EDM Replace carriage return?
David Kindred
Fri, 14 Jan 2000 16:44:59 -0500

Sure, Don. Hope Keving won't mind me sharing his methodology. He's the smart
one with the weather parsing, for I only copied his stuff. Okay, first you
need a batch file. Here's the one I plan on running at 5:30AM each morning.
It sets the time, sends me a test message and gets the local forecast:

DAILY_INET.BAT
DEL ISPSTAT.DAT

START /W RASDIAL "Internet Express" ebrains phantom

rem ------Reset the PC's clock
C:\utils\D4Time\d4.exe

rem ------Email a test message
C:\utils\postie\postie -s:"Test Message" -msg:"Here is a test
message" -host:smtp.x-press.net -from:ebrains@x-press.net -to:david_kindred@
iname.com

rem ------Get the weather forecast
wpdl http://iwin.nws.noaa.gov/iwin/md/zone.html files\weather.htm
e /k:wxparse.edm

rem Save exit status:
IF ERRORLEVEL 1 GOTO ERR
ECHO D > ISPSTAT.TMP
GOTO EXIT

:ERR
ECHO E > ISPSTAT.TMP

:EXIT
rem Disconnect:
rem START /W RASDIAL /DISCONNECT
rem Tell ECS that we are finished:
COPY ISPSTAT.TMP ISPSTAT.DAT


and here's Kevin's parsing routine:

WXPARSE.EDM
Bell			'kill the bell
cd files		'move into my file subdirectory
r weather.htm	'read the raw html file into edm
f montgomery	'find the keyword of "Montgomery" (my county)
d-			'nuke all the lines before it
f $$			'find the end of the forecast ($$$)
d+			'nuke all the lines after it
CWA/ WIND WINDE	'change the spelling of "wind" so it's pronounced correctly
100wd			'I think this undoes some word wrapping
CA/ ... ,		'replace all elipses with commas
c/ .  		'replace the remaining periods with spaces (you can't see that)
c/ , , 		'replace the commas with a comma and a space (you can't see that)
w wxtemp.txt	'write a temporary file
t			'move to the top of the file
f/ EXTENDED FORECAST	'isolate the extended forecast part
d-			'nuke the lines before it
w wxextended.txt	'write it out to a separate file
r wxtemp.txt	'read the temp file
f EXTENDED FORECAST	'isolate today's forecast
d+			'nuke the rest of the lines
w wxtoday.txt	'write it to a separate file
q			'quit


Now, I just have ECS read me either the local or extended forecast file.

--David

-----Original Message-----
From: Don Stephens [mailto:donstephens@101freeway.com]
Sent: Friday, January 14, 2000 1:09 PM
To: ecs-list@netbloc.com
Subject: Re: [ECS] EDM Replace carriage return?


Weather Script?...Could I take a look?

Don

----- Original Message -----
From: "David Kindred" <david_kindred@iname.com>
To: <ecs-list@netbloc.com>
Sent: Friday, January 14, 2000 9:37 AM
Subject: RE: [ECS] EDM Replace carriage return?


> Kevin,
>
> Yeah, isn't it a bummer? I've been trying to figure out how to get rid of
> those pauses. It looks like the best way might be to write a little app to
> strip off the carriage returns. I guess I might have to do that. Oh, well.
>
> Thanks again for your weather forecast script, Kevin. It's excellent to
have
> that functionality, now!
>
> --David
>
> -----Original Message-----
> From: Kevin Keast [mailto:libertyc@prodigy.net]
> Sent: Friday, January 14, 2000 10:11 AM
> To: ecs-list@netbloc.com
> Subject: RE: [ECS] EDM Replace carriage return?
>
>
> David,
>
> That is problem with that particular WX file.  If we can replace those
> carriage returns.  I think it would help a bunch.
>
> Kevin
>
>
>


  subject (prev) or (next) | time (prev) or (next) | author (prev) or (next) | view more subjects




Services provided by [NetBloc]®! NetBloc Solutions Inc.
Terms of use. Indexing software (c) 1999 Lin-De, Inc
.