Skip to content

Instantly share code, notes, and snippets.

@dkordik
Created July 7, 2011 19:52
Show Gist options
  • Save dkordik/1070385 to your computer and use it in GitHub Desktop.
Save dkordik/1070385 to your computer and use it in GitHub Desktop.
Check to see if Twitter is back up. I use it to let me know when we're no longer rate-limited and I can get back to working on Twitter stuff.
i = setInterval(function () {
jQuery.ajax({
url: 'http://twitter.com/users/show_for_profile.json?screen_name=dkordik',
complete: function (data) {
if (JSON.parse(data.responseText)["error"]==undefined) {
alert("IT'S BACK BABY!"); //brings focus to the twitter tab!
clearInterval(i);
location.reload();
} else {
console.log("TWITTER? ", JSON.parse(data.responseText)["error"], " " + Date().toString());
}
}
});
}, 60000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment