Skip to content

Instantly share code, notes, and snippets.

@Zetaphor
Created November 18, 2024 17:54
Show Gist options
  • Save Zetaphor/034756d24591361526605fc4df06f7c2 to your computer and use it in GitHub Desktop.
Save Zetaphor/034756d24591361526605fc4df06f7c2 to your computer and use it in GitHub Desktop.
Mastodon.net User Counts
const userCounts = [];
document.querySelectorAll('.fa-robot-astromech').forEach(el => {
const text = el.closest('p').innerText;
const count = parseInt(text.match(/[\d,]+/)[0].replace(/,/g, ''));
userCounts.push(count);
});
const totalUsers = userCounts.reduce((sum, count) => sum + count, 0);
console.log(`Total users: ${totalUsers.toLocaleString()}`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment