d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Max 4 Topics In Top 50 Rule..
Add Reply New Topic New Poll
Member
Posts: 7,088
Joined: Mar 28 2014
Gold: 0.00
Dec 12 2025 12:53am
If you're pesky like me and don't appreciate people putting up more than 4 of their topics on the top 50(which is not allowed), here's a little code snippet to count em out so you can easily find people whom's topics to report for rule breaking :thumbsup:


Code
// Count number of topics in top 50 per user
const rows = document.querySelectorAll('table tbody tr');

const counts = {};

// Collect counts
rows.forEach(row => {
const author = row.querySelector('td:nth-child(3) a[href^="user.php?i="]');
if (!author) return;

const username = author.textContent.trim();
counts[username] = (counts[username] || 0) + 1;
});

// Add to array and sort by largest int count
const sorted = Object.entries(counts)
.sort((a, b) => b[1] - a[1]);

console.log(sorted);
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll