Re: Scripting NOAA Weather data for an iPod
Re: Scripting NOAA Weather data for an iPod
- Subject: Re: Scripting NOAA Weather data for an iPod
- From: "Stockly, Ed" <email@hidden>
- Date: Wed, 09 Jul 2008 11:56:45 -0700
- Thread-topic: Scripting NOAA Weather data for an iPod
Title: Re: Scripting NOAA Weather data for an iPod
> I'm interested in sucking the weather forecast text off a NOAA web
> page for my location, converting the text to audio, and then placing
> it into iTunes so I can listen to it on an iPod.
A neat idea, and something applescript is especially suited for...
set laWeatherURL to "http://www.wrh.noaa.gov/forecast/MapClick.php?site=lox&smap=1&textField1=34.05222&textField2=-118.24278"
tell application "Safari"
make new document with properties {URL:laWeatherURL}
delay 2 --may not be needed
set weatherText to text of document 1
end tell
set AppleScript's text item delimiters to "Hazardous Weather Outlook"
set weatherText to text item 2 of weatherText
say weatherText with waiting until completion
Add the “saving to” parameter to the say command and you can save the sound to aiff file that you could then import into itunes.
If this were me, I’d work with the text a little more.
I’d replace “mph” with “miles per hour” and *F with farenheight and *C with Centigrade
And there’s a lot more extraneous webby stuff you could filter out.
HTH,
ES
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden