PowerShell Controlled Railway Signal

So tonight on Twitter, SlipperySeal decided to unleash his Raspberry Pi controlled railway signals upon us. Using a web page, you can enable or disable the lights. I decided to take it one step further and hijack the page with a cheeky bit of PowerShell. I pulled out the URLs called when you update the lights, and used the Start-Sleep cmdlet to time my fake clicks.

http://pimpmylight.catchpole.net/?update=green
http://pimpmylight.catchpole.net/?update=orange
http://pimpmylight.catchpole.net/?update=red

The PowerShell to do this was quite simple:

$wc = New-Object System.Net.WebClient 
$uri = "http://pimpmylight.catchpole.net/?update=green"
while ($true) { 
  $null = $wc.DownloadString($uri); 
  "Green!"; 
  Start-Sleep -milliseconds 500 
}

Three copies, running at three different time intervals, and we had this:

Written on July 2, 2014