Skip to content

Instantly share code, notes, and snippets.

@marcojetson
Last active August 29, 2015 13:56

Revisions

  1. marcojetson revised this gist Feb 6, 2014. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions service-status.js
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    // check<Service>Status([ onSuccess, onFailure ]);
    // i.e checkTaringaStatus(function () { alert('+10'); });
    (function () {
    var checkServiceStatus = function (image, success, error) {
    return function (success, error) {
    @@ -10,5 +12,6 @@

    window.checkGoogleStatus = checkServiceStatus("https://accounts.google.com/CheckCookie?continue=https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fimages%2Flogos%2Faccounts_logo.png&followup=https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fimages%2Flogos%2Faccounts_logo.png&chtml=LoginDoneHtml&checkedDomains=youtube&checkConnection=youtube%3A291%3A1");
    window.checkGooglePlusStatus = checkServiceStatus("https://plus.google.com/up/?continue=https://www.google.com/intl/en/images/logos/accounts_logo.png&type=st&gpsrc=ogpy0");
    window.checkTaringaStatus = checkServiceStatus("https://www.taringa.net/login?redirect=/img/logo.png");
    window.checkTwitterStatus = checkServiceStatus("https://twitter.com/login?redirect_after_login=%2Fimages%2Fspinner.gif");
    }());
  2. marcojetson renamed this gist Feb 4, 2014. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. marcojetson created this gist Feb 4, 2014.
    14 changes: 14 additions & 0 deletions gistfile1.js
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    (function () {
    var checkServiceStatus = function (image, success, error) {
    return function (success, error) {
    var img = new Image();
    img.onload = success || function () {};
    img.onerror = error || function () {};
    img.src = image;
    };
    };

    window.checkGoogleStatus = checkServiceStatus("https://accounts.google.com/CheckCookie?continue=https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fimages%2Flogos%2Faccounts_logo.png&followup=https%3A%2F%2Fwww.google.com%2Fintl%2Fen%2Fimages%2Flogos%2Faccounts_logo.png&chtml=LoginDoneHtml&checkedDomains=youtube&checkConnection=youtube%3A291%3A1");
    window.checkGooglePlusStatus = checkServiceStatus("https://plus.google.com/up/?continue=https://www.google.com/intl/en/images/logos/accounts_logo.png&type=st&gpsrc=ogpy0");
    window.checkTwitterStatus = checkServiceStatus("https://twitter.com/login?redirect_after_login=%2Fimages%2Fspinner.gif");
    }());