Make sure you're logged in at https://in.yourparty.uk then navigate to your country or region:
- North West of England
- North East of England
- Yorkshire
- East of England
- West Midlands
- East Midlands
- South East of England
- South West of England
- South West of England
- London
- Wales
- Scotland
- Public office holders
Open the Javascript console in your browser:
| Windows | Mac | |
|---|---|---|
| Chrome/Edge | Command+Option+J | Ctrl+Shift+J |
| Firefox | Command+Option+K | Ctrl+Shift+J |
Then paste the following code, and hit Enter. The ranked results will display on the page and be copied to your clipboard.
// Get all the candidate popups and grab names and endorsements for both
const candidates = Array.from(document.querySelectorAll('[id^=candidate]')).map($modal => {
const name = $modal.querySelector('.modal-title').textContent.slice(0, -2);
const endorsements = $modal.querySelector('.modal-body > :last-child').textContent.split('currently has ')[1].split(' ')[0];
return { name, endorsements };
})
// Sort highest to lowest
.sort((a, b) => b.endorsements - a.endorsements);
// Draw up a ranked table on the page
document.querySelector('h2').innerHTML += `
<h3>Results as of ${new Date().toLocaleString()}:</h3>
<table class="table table-striped" style="position: relative;border-collapse: collapse;">
<thead>
<tr style="background-color: #FAF6E8;position: sticky;top: 0;">
<th>Candidate</th>
<th>Endorsements</th>
</tr>
</thead>
<tbody>
${candidates.map(candidate => `
<tr>
<td>${candidate.name}</td>
<td>${candidate.endorsements}</td>
</tr>
`).join('')}
</tbody>
</table>
`;
// Copy to clipboard as text
copy(candidates.map(candidate => `${candidate.name}: ${candidate.endorsements}`).join('\n'));