Skip to content

Instantly share code, notes, and snippets.

@dustingetz
Created April 6, 2011 04:48
Show Gist options
  • Select an option

  • Save dustingetz/905150 to your computer and use it in GitHub Desktop.

Select an option

Save dustingetz/905150 to your computer and use it in GitHub Desktop.
var oPosts = $('table td .title a');
oPosts.each(function(index, oPost){
var sTitle = oPost.innerHTML;
var oScoreRow = $(oPost).parent().parent().next();
var sVotes = oScoreRow.find('span')[0].innerHTML;
var sComments = oScoreRow.find('a')[1].innerHTML;
var numComments = parseInt(sComments.split(' '));
var numVotes = parseInt(sVotes.split(' '));
var score = numVotes/numComments;
//console.log(sTitle + ':::' + score);
if (score < 2) $(oPost).css('color', 'red');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment