Skip to content

Instantly share code, notes, and snippets.

@lehrblogger
Created November 7, 2012 01:59
Show Gist options
  • Save lehrblogger/4029114 to your computer and use it in GitHub Desktop.
Save lehrblogger/4029114 to your computer and use it in GitHub Desktop.
NYT Election Coverage for the Impatient
//In the Javascript console on http://elections.nytimes.com/2012/results/president, paste the following:
NYTD.NYTINT.Bigboard.Bigboard.prototype.render_timer = function() {
// Do nothing if the board isn't live.
if (!this.is_live()) {
return false;
}
// If we've counted to zero, re-load the data.
// Otherwise, decrement the counter.
if (this.interval <= 0) {
this.fetch();
} else {
this.interval = this.interval - 5; // or however quickly you want to count down from 30 seconds
}
// Compute the time-remaining string
var minutes = Math.floor(this.interval / 60);
var seconds = this.interval % 60;
if (seconds < 10) {
seconds = '0' + seconds;
}
$(".countdown-timer").show().html(minutes + ':' + seconds);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment