Hi,
I tried to update the old "down for everyone or just me" v1 extension from David Ferguson to v2. But it doesn't work. In either case, it just says it's down (and google is NOT down).
Here is the php code which needs to run (and works fine in v1):
<?php
/* -----------------------------------
Script: Down For Everyone or Just Me
Author: David Ferguson
Usage: down <host>
Desc: Uses the website downforeveryoneorjustme.com
to determine if a site is up. Returns status
via Growl.
Updated: 7/8/11
----------------------------------- */
//Pull hostname off of the command line
$q=$argv[1];
//Retrieve status from isup.me
$url = "http://www.isup.me/$q";
$crl = curl_init();
$timeout = 10;
curl_setopt ($crl, CURLOPT_URL, $url);
curl_setopt ($crl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($crl, CURLOPT_CONNECTTIMEOUT, $timeout);
$def = curl_exec($crl);
curl_close ($crl);
//Search the result text to determine the status
$find = strpos($def, "It's just you.");
//Return status
if ($find) { echo "It's just you. ".ucfirst($q)." is up."; }
else { echo "It's not just you. ".ucfirst($q)." is down."; }
How do i get this working in a workflow?