Hello. First time poster here. I hope this hasn't been done before, but I thought I would share a little code I wrote.
I am using the XML roster feed found on the EQ2 players site. I am also using a custom XSLT file I built found
. I am sorting by level at the moment. Hopefully later today I will have one for sorting by rank and then by level.
Since the feed does not return the cool little totals that are on eq2players.com (and since I am too lazy to just buy a dang site and do the counting server-side), I made a little javascript to return count and display the number of each class.
<table style="margin-top: 10px;">
<tbody>
<tr>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Berserker</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Guardian</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Paladin</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Shadow Knight</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Bruiser</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Monk</td>
</tr>
<tr>
<td style="text-align: center;"><span id="spn_Berserker_count">0</span></td>
<td style="text-align: center;"><span id="spn_Guardian_count">0</span></td>
<td style="text-align: center;"><span id="spn_Paladin_count">0</span></td>
<td style="text-align: center;"><span id="spn_SK_count">0</span></td>
<td style="text-align: center;"><span id="spn_Bruiser_count">0</span></td>
<td style="text-align: center;"><span id="spn_Monk_count">0</span></td>
</tr>
</tbody>
</table>
<table style="margin-top: 10px;">
<tbody>
<tr>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Templar</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Inquisitor</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Defiler</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Mystic</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Warden</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Fury</td>
</tr>
<tr>
<td style="text-align: center;"><span id="spn_Templar_count">0</span></td>
<td style="text-align: center;"><span id="spn_Inquisitor_count">0</span></td>
<td style="text-align: center;"><span id="spn_Defiler_count">0</span></td>
<td style="text-align: center;"><span id="spn_Mystic_count">0</span></td>
<td style="text-align: center;"><span id="spn_Warden_count">0</span></td>
<td style="text-align: center;"><span id="spn_Fury_count">0</span></td>
</tr>
</tbody>
</table>
<table style="margin-top: 10px;">
<tbody>
<tr>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Assassin</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Ranger</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Brigand</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Swashbuckler</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Troubador</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Dirge</td>
</tr>
<tr>
<td style="text-align: center;"><span id="spn_Assassin_count">0</span></td>
<td style="text-align: center;"><span id="spn_Ranger_count">0</span></td>
<td style="text-align: center;"><span id="spn_Brigand_count">0</span></td>
<td style="text-align: center;"><span id="spn_Swashbuckler_count">0</span></td>
<td style="text-align: center;"><span id="spn_Troubador_count">0</span></td>
<td style="text-align: center;"><span id="spn_Dirge_count">0</span></td>
</tr>
</tbody>
</table>
<table style="margin-top: 10px;">
<tbody>
<tr>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Wizard</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Warlock</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Conjuror</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Necromancer</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Coercer</td>
<td style="text-align: center ! important; width: 120px;" class="ForumCategoryHeader">Illusionist</td>
</tr>
<tr>
<td style="text-align: center;"><span id="spn_Wizard_count">0</span></td>
<td style="text-align: center;"><span id="spn_Warlock_count">0</span></td>
<td style="text-align: center;"><span id="spn_Conjuror_count">0</span></td>
<td style="text-align: center;"><span id="spn_Necromancer_count">0</span></td>
<td style="text-align: center;"><span id="spn_Coercer_count">0</span></td>
<td style="text-align: center;"><span id="spn_Illusionist_count">0</span></td>
</tr>
</tbody>
</table>
<script type="text/javascript">
$(document).ready(function(){
var classes = document.getElementById("tbl_roster").innerHTML;
var berserker_matches = 0;
var guardian_matches = 0;
var paladin_matches = 0;
var sk_matches = 0;
var bruiser_matches = 0;
var monk_matches = 0;
var templar_matches = 0;
var inquisitor_matches = 0;
var defiler_matches = 0;
var mystic_matches = 0;
var warden_matches = 0;
var fury_matches = 0;
var assassin_matches = 0;
var ranger_matches = 0;
var brigand_matches = 0;
var swashbuckler_matches = 0;
var troubador_matches = 0;
var dirge_matches = 0;
var wizard_matches = 0;
var warlock_matches = 0;
var conjuror_matches = 0;
var necromancer_matches = 0;
var coercer_matches = 0;
var illusionist_matches = 0;
berserker_matches = classes.match(/Berserker/g);
guardian_matches = classes.match(/Guardian/g);
paladin_matches = classes.match(/Paladin/g);
sk_matches = classes.match(/Shadow Knight/g);
bruiser_matches = classes.match(/Bruiser/g);
monk_matches = classes.match(/Monk/g);
templar_matches = classes.match(/Templar/g);
inquisitor_matches = classes.match(/Inquisitor/g);
defiler_matches = classes.match(/Defiler/g);
mystic_matches = classes.match(/Mystic/g);
warden_matches = classes.match(/Warden/g);
fury_matches = classes.match(/Fury/g);
assassin_matches = classes.match(/Assassin/g);
ranger_matches = classes.match(/Ranger/g);
brigand_matches = classes.match(/Brigand/g);
swashbuckler_matches = classes.match(/Swashbuckler/g);
troubador_matches = classes.match(/Troubador/g);
dirge_matches = classes.match(/Dirge/g);
wizard_matches = classes.match(/Wizard/g);
warlock_matches = classes.match(/Warlock/g);
conjuror_matches = classes.match(/Conjuror/g);
necromancer_matches = classes.match(/Necromancer/g);
coercer_matches = classes.match(/Coercer/g);
illusionist_matches = classes.match(/Illusionist/g);
if (berserker_matches != null) {
document.getElementById("spn_Berserker_count").innerHTML = berserker_matches.length;
}
if (guardian_matches != null) {
document.getElementById("spn_Guardian_count").innerHTML = guardian_matches.length;
}
if (paladin_matches != null) {
document.getElementById("spn_Paladin_count").innerHTML = paladin_matches.length;
}
if (sk_matches != null) {
document.getElementById("spn_SK_count").innerHTML = sk_matches.length;
}
if (bruiser_matches != null) {
document.getElementById("spn_Bruiser_count").innerHTML = bruiser_matches.length;
}
if (monk_matches != null) {
document.getElementById("spn_Monk_count").innerHTML = monk_matches.length;
}
if (templar_matches != null) {
document.getElementById("spn_Templar_count").innerHTML = templar_matches.length;
}
if (inquisitor_matches != null) {
document.getElementById("spn_Inquisitor_count").innerHTML = inquisitor_matches.length;
}
if (defiler_matches != null) {
document.getElementById("spn_Defiler_count").innerHTML = defiler_matches.length;
}
if (mystic_matches != null) {
document.getElementById("spn_Mystic_count").innerHTML = mystic_matches.length;
}
if (warden_matches != null) {
document.getElementById("spn_Warden_count").innerHTML = warden_matches.length;
}
if (fury_matches != null) {
document.getElementById("spn_Fury_count").innerHTML = fury_matches.length;
}
if (assassin_matches != null) {
document.getElementById("spn_Assassin_count").innerHTML = assassin_matches.length;
}
if (ranger_matches != null) {
document.getElementById("spn_Ranger_count").innerHTML = ranger_matches.length;
}
if (brigand_matches != null) {
document.getElementById("spn_Brigand_count").innerHTML = brigand_matches.length;
}
if (swashbuckler_matches != null) {
document.getElementById("spn_Swashbuckler_count").innerHTML = swashbuckler_matches.length;
}
if (troubador_matches != null) {
document.getElementById("spn_Troubador_count").innerHTML = troubador_matches.length;
}
if (dirge_matches != null) {
document.getElementById("spn_Dirge_count").innerHTML = dirge_matches.length;
}
if (wizard_matches != null) {
document.getElementById("spn_Wizard_count").innerHTML = wizard_matches.length;
}
if (warlock_matches != null) {
document.getElementById("spn_Warlock_count").innerHTML = warlock_matches.length;
}
if (conjuror_matches != null) {
document.getElementById("spn_Conjuror_count").innerHTML = conjuror_matches.length;
}
if (necromancer_matches != null) {
document.getElementById("spn_Necromancer_count").innerHTML = necromancer_matches.length;
}
if (coercer_matches != null) {
document.getElementById("spn_Coercer_count").innerHTML = coercer_matches.length;
}
if (illusionist_matches != null) {
document.getElementById("spn_Illusionist_count").innerHTML = illusionist_matches.length;
}
})
</script>
If anyone knows a more efficient way to do this, please let me know!