Skip to content

Instantly share code, notes, and snippets.

@watagashi
Created July 28, 2011 15:23
Show Gist options
  • Save watagashi/1111738 to your computer and use it in GitHub Desktop.
Save watagashi/1111738 to your computer and use it in GitHub Desktop.
twicli plugin, measures againt API errror
function twAuthFallback() {
// verify_credentials API is unavailable?
re_auth = true;
xds.load_default(twitterAPI + "users/show.json?suppress_response_codes=true&screen_name="+myname, twAuth);
}
function auth() {
if (use_ssl)
twitterAPI = twitterAPI.replace('http', 'https');
var name = readCookie('access_user');
if (name) {
name = name.split('|');
myname = last_user = name[0];
myid = name[1];
$("user").innerHTML = last_user;
update();
}
xds.load(twitterAPI + "account/verify_credentials.json?suppress_response_codes=true", twAuth, twAuthFallback, 1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment