Блог пользователя direction_

Автор direction_, история, 4 года назад, По-английски

Is there any way still like I can get basic user information for their codechef profile like handle, contest rating, country Ranking, Globel Ranking, and the total number of questions solved all time?

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
2 года назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Hey, see if this helps- https://codechef-api.vercel.app/{username} replace {username} with your codechef id

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    It's working.

  • »
    »
    2 года назад, скрыть # ^ |
     
    Проголосовать: нравится 0 Проголосовать: не нравится

    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');
        }
    }

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

»
22 месяца назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

Can there be an API for dead users as well? it will help a lot, as lot of programmers don't give contests upon reaching a desired rating range.

»
12 месяцев назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится

The deployment is paused now