Sunday, April 17, 2005

apple alarm

In an ongoing effort to automate my lifestyle and further geekify my existence, I am designing a custom alarm clock using Applescript and my iBook. I was very surprised to learn how easy it was to invoke other applications via Applescript. Currently my alarm is set to begin playing an iTunes playlist 10 minutes before I have to wake up. The volume starts very soft and builds until my wake up time. At wake up time, new music follows along with a voice automated greeting informing me of the current time and the current weather (this part is still in the works).The next stage is even louder music coupled with loud time announcements every five minutes. The getweather bit is basically a screen scrape of weather.com using curl...

curl -s http://www.weather.com/outlook/travel/businesstraveler/local/$1 | grep '&temp' |
sed s/.*36hr\&temp=/'The current temperature is '/g |
sed s/\&uv.*\&cond/' degrees. The current condition is '/g |
sed s/\&templ1.*/' '/g |
sed s/=clear_mostly/'mostly clear.'/g |
sed s/=cloud_partly/'partly cloudy.'/g |
sed s/=cloud_mostly/'mostly cloudy.'/g

This should work at least until they changed their page structure. As far as I know weather.com does not have free web services. BUUT if they did, I could use Applescript's built in Soap request functionality! Anyway this will be fine for now. I'm also looking into creating scripts to log into web mail and retrieve my messages, and eventually tie that to some voice response system so I could call in on my cell and get my email. Thats a little far off for now, but will keep me busy. Besides I can't automate too much, I spend most of my day sitting around being lazy anyway.

No comments:

Post a Comment