Skip to content

Instantly share code, notes, and snippets.

@judell
Created October 5, 2024 21:17
Show Gist options
  • Save judell/bf74cafa8fd7de76e5bb266461c15d03 to your computer and use it in GitHub Desktop.
Save judell/bf74cafa8fd7de76e5bb266461c15d03 to your computer and use it in GitHub Desktop.
votefwd-1

Claude ChatGPT
function parseHTML() {
    const items = document.querySelectorAll('li.bundle-list-item');
    const results = [];
    items.forEach(item => {
        const idSpan = item.querySelector('span.font-monospace');
        if (idSpan) {
            const id = idSpan.textContent.trim();
            const status = item.getAttribute('data-testid').split('-').pop();
            results.push(`${id} ${status}`);
        }
    });
    return results;
}

function displayResults(results) { console.log(results.join('\n')); }

const parsedResults = parseHTML(); displayResults(parsedResults);

const bundles = document.querySelectorAll('li.bundle-list-item');

bundles.forEach(bundle => { const userId = bundle.querySelector('span.font-monospace').textContent.trim(); const dataTestId = bundle.getAttribute('data-testid'); const status = dataTestId.split('-').pop(); console.log(${userId} ${status}); });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment