Speak the weather
So, I am working on creating a Good Morning script to help wake myself up since im a heavy sleeper and I want to. This is the first part ive worked on, it will go get the weather, parse the xml, and read it to me.
If interested, or you want to mess around with the XML, you can find your US cities XML here
Posted Feb 21, 2017, 6:33 PM UTC · edited
156
I am curious why you saved the XML file first, then reloaded the file instead of using the results of invoke-webrequest directly...? (I'm near Cleveland...)
I'd prefer to see some error handling that exclaims "Wake up! I'm broken"
Not sure if I will or not, since I copy the xml locally, if the next web request fails, it will fall back to yesterdays report. I could call the updated time from the XML and compare it to the current date and make a separate message to alert me to this.
I messed with it last night when i got home, but my bluetooth soundbar is a bit too far from my computer, so I might move that and test some more.
I had no idea System.Speech was a thing, so thanks for this. I'm probably going to spend too much time making my co-workers' computers talk
That is what I originally used the function for :P
Here's where I stole it from. http://mattblogsit.com/oob/powershell-pranks-making-work-fun-with-creepy-voices
Honestly, I just followed an example on a blog post or site and edited for my use. I assumed that it was better to work with a local copy instead of directly from the web.
Now that you point it out, that is probably fine. The site rarely goes down and either does my internet.