Tag Archives: nowork

Internet-radio built in powershell

SRLast weekend I had an hour or two over after my kids gone to sleep, to do some scripting at home. I got an idea of building an internet radio in powershell with the four nationwide Swedish public service channels.  I used the .NET framework class System.Windows.Media.MediaPlayer to play the streams and then some variables to feed it. First of you could only choose channel when you ran the function and the only option was quit, but I built in a meny so you will be able to change channel without quiting the function. When I proudly showed the internet radio player to my girlfriend she told me it looked like crap and asked why I just don´t go to the sr.se site…

Monitor solresor and notify when hotel is available

Last friday me and my girlfriend finally decided a hotel and date for the summer holiday. She had found a hotel to reasonable price at the travel-agent solresor. I told her I just had to eat and would book the trip right after lunch. When I came back the hotel was sold-out at the date we had planned for. I called the travel-agent and asked if they had any notification-service, if someone would cancel their trip, unfortunate they had no such service and they told me to check their website manually to see if the hotel would reappear. Since I am lazy and didn´t want to manually check their website a built a script to do it for me.
I found out that on step 4 in their booking the website created an unique URL with hotel short-name and departure date, if I used that URL I would get an answer with body if the hotel and date were available and I would get an empty answer if the date was sold-out.
So I made a script that checked the URL once every minute and would send me an email if the URL existed. Unfortunately the hotel never showed up, but it was fun to create the monitor.