Skip to content

Instantly share code, notes, and snippets.

@kmorey
Last active October 5, 2015 06:48
Show Gist options
  • Save kmorey/2766215 to your computer and use it in GitHub Desktop.
Save kmorey/2766215 to your computer and use it in GitHub Desktop.
Update NBA title with score
function update_title() {
var score = [];
jQuery('.jumbo_digit').each(function() {
score.push(this.className.replace(/\s*jumbo_digit\s*/g, '').replace(/none|digit/g, ''));
});
var qtr = jQuery("#quarter_indicator").text();
var time = jQuery("#time_indicator").text();
document.title=score.slice(0, 3).reverse().join('') + '-' + score.slice(3, 6).reverse().join('') +
' ' + qtr + ' (' + time + ')';
}
setInterval(update_title, 10000);
update_title();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment