Permalink
Browse files

Rewrote parrot.ps1 to actually use the parrot.live http server. Renam…

…ed to parrot-dance.ps1.
  • Loading branch information...
stevefranchak committed Mar 27, 2018
1 parent 605b5e3 commit b21719862a203b1f4a39833567087a057df7fdd7
Showing with 31 additions and 4 deletions.
  1. +31 −0 parrot-dance.ps1
  2. +0 −4 parrot.ps1
View
@@ -0,0 +1,31 @@
<#
.SYNOPSIS
Makes a parrot dance on your shell.
.EXAMPLE
./parrot-dance.ps1
#>
$request = [System.Net.HttpWebRequest]::Create("http://parrot.live");
$response = $request.GetResponse();
$receiveStream = $response.GetResponseStream();
$readStream = [System.IO.StreamReader]::new($receiveStream);
[console]::TreatControlCAsInput = $true;
$initialForegroundColor = [Console]::ForegroundColor;
while ($line = $readStream.ReadLine()) {
if ([Console]::KeyAvailable) {
$key = [System.Console]::ReadKey($true)
if (($key.modifiers -band [ConsoleModifiers]"control") -and ($key.key -eq "C"))
{
break;
}
}
[Console]::WriteLine($line);
}
$readStream.Close();
$receiveStream.Close();
$request.Abort();
[console]::TreatControlCAsInput = $false;
[Console]::ForegroundColor = $initialForegroundColor;
View

This file was deleted.

Oops, something went wrong.

0 comments on commit b217198

Please sign in to comment.