$CurStatus = "PSN Status: OFFLINE"

$EmailAddr = “your email address”

$Password = "your password"

$Subject = “PSN Status Update”

$SmtpServer = “smtp.gmail.com”

$MailClient = New-Object Net.Mail.SmtpClient ( $SmtpServer , 587 )

$MailClient .EnableSsl = $true

$MailClient .Credentials = New-Object System.Net.NetworkCredential ( $EmailAddr , $Password )

$WebClient = New-Object System.Net.WebClient

$PsnUrl = "https://support.us.playstation.com/app/home"

while ( $true ) {

$site_content = $WebClient .DownloadString ( $PsnUrl ) - split " `n "

foreach ( $line in $site_content ) {

#echo $line

if ( $line .contains ( "PSN Status:" ) ) {

$status_idx = $line .indexOf ( "PSN Status:" ) # Get the index of the status string in $line

$status = $line .substring ( $status_idx )

echo "$status"

if ( -not $status .contains ( $CurStatus ) ) { # Has the status changed?

$CurStatus = $status # Yep. Update the current status string ...

# ... and send out a notification

try {

$MailClient .Send ( $EmailAddr , $EmailAddr , $Subject , $CurStatus )

} catch {

exit # Uh oh

}

echo "Sent out status update notification email to $EmailAddr."

}

break # Assuming the first status string is actually the status!

}

}

$SleepTimeSec = 30

sleep $SleepTimeSec # DDoS Mitigation (Lulz)