Comments

I have the same issue... Why it is not considering that case??

This is not working now... My codechef handle is jai_kumar30 Could you please resolve the problem in my code? Am I doing something wrong?

// Fetch CodeChef data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ async function fetchCodechefData() { const url=https: //codechef-api.vercel.app/{jai_kumar30};

try {
    const response=await fetch(url);

    if ( !response.ok) {
        throw new Error(`HTTP error ! status: $$$ { response.status }<br /><br /> '); }<br /><br /> const data=await response.json();<br /><br /> if (data.status==='OK') { const user=data.result; // Adjust based on the actual structure<br /><br /> document.getElementById('codechef-rating').textContent='Rating: $$$ {
            user.rating || 'Unrated'
        }

        `;
    }

    else {
        throw new Error('Failed to fetch data');
    }
}

catch (error) {
    console.error('Error:', error);
    const ratingElement=document.getElementById('codechef-rating');

    if (ratingElement) {
        ratingElement.textContent='Error fetching rating';
    }

    else {
        console.error('Element not found');
    }
}

} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~