JMoVS Posted March 17, 2013 Posted March 17, 2013 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?
jdfwarrior Posted March 17, 2013 Posted March 17, 2013 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? Looks like it may just be the service right now. isup.me is part of downforeveryoneorjustme.com and I can't get either to open right now.
JMoVS Posted March 17, 2013 Author Posted March 17, 2013 (edited) Well, http://downforeveryoneorjustme.com/ works for me. But how do I execute this in Alfred? Do I use php shell? And where to put {query} in what form? I am a mere user of the extension and can't fiddle with php really ;-) Thx so far! hmm, was able to open the site but not to look if it's down or not. Strange How much work would it be to use http://isitup.org/ instead? Edited March 17, 2013 by !62/7<?3
phallstrom Posted March 17, 2013 Posted March 17, 2013 I'm bored... here's a workflow for isitup.org... https://dl.dropbox.com/u/23115266/Is%20It%20Up.alfredworkflow No PHP, just bash and curl.
JMoVS Posted March 17, 2013 Author Posted March 17, 2013 thx, but your workflow just shows the domin name but doesn't echo whether it's up or down.
jdfwarrior Posted March 18, 2013 Posted March 18, 2013 thx, but your workflow just shows the domin name but doesn't echo whether it's up or down. No PHP, just bash and curl domain="{query}"; out=$(curl -s "http://isup.me/$domain" | grep "is up."); if [ -z $out ]; then echo "It's not just you, $domain is down"; else echo "It's just you, $domain is up"; fi Create a keyword, add a Run Script module, drop in that code, attach it to a Notification module, bam. Done. JMoVS 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now