Skip to content

Instantly share code, notes, and snippets.

@billynyh
Created December 19, 2014 10:23
Show Gist options
  • Save billynyh/3d84924fcc3f770edc26 to your computer and use it in GitHub Desktop.
Save billynyh/3d84924fcc3f770edc26 to your computer and use it in GitHub Desktop.
dirty script to filter out hkoi result, need jquery
// run in chrome developer console
var tables = $(".main table");
var TD = '<td style="width:40px; text-align:center">';
function fill_rank(st, ed){
var rank = 1;
for(var i=st; i<ed; i++){
$(tables[i]).find("tr").each(function(){
var row = $(this);
var td = $(row.find("td")[1]);
if (td.text().indexOf("香港培正中學")>0){
row.addClass("pcms");
}
row.prepend(TD+rank+'</td>');
rank++;
});
$(tables[i]).addClass("x");
}
}
fill_rank(0,3);
fill_rank(3,6);
$(".main table.x tr").hide();
$(".main table.x tr.pcms").show();
$(".main h3").width(400);
javascript:(function ()%7B%0A if(window.jQuery)%7B%0A%0A %7Delse%7B%0A var script = document.createElement("script");%0A script.src = "//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js";%0A document.head.appendChild(script);%0A %0A %7D%0A %0A%7D())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment