Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

85
Vistas
I have a problem fetching data from codeforces to my github profile

I have a problem fetching data from codeforces to my github profile I can't add a js code to the readme.md file to fetch data from codeforces When I'm trying to write a js code like this it appears as a text.

    <script>
      
fetch('https://codeforces.com/api/user.status?handle=sadeen&from=1&count=10').then(response => response.json()).then(characters => showCharacters(characters.results));
  showCharacters = characters => {
  const charactersDiv = document.querySelector(‘#rick-and-morty-  characters’);
  characters.forEach(character => {
    const characterElement = document.createElement(‘p’);
    characterElement.innerText = `Character Name: ${character.name}`;
    charactersDiv.append(characterElement);
  });
}
    </script>
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You would not call a javascript program directly from a profile README.md.

But you can set up a GitHub Action to update said README.md, and that action can call anything.

See for instance "Self-updating GitHub Profile README with JavaScript" by Dan Curtis.

GitHub recently released a feature that allows users to add markdown to their profile.
People have done some pretty cool things, which inspired me to create a README that dynamically updates with my Dev.to posts.
GitHub Actions and NodeJS make this easy.
I created a script to:

  • Get my Dev.to articles
  • Parse my README
  • Update the README with my latest articles

You'll need 3 files: .github/workflows/build.yaml, updateReadme.js, and README.md

Example of .github/workflows/build.yaml, running automatically 3 times a week:

# Name of workflow
name: Build README

# Run workflow at 12:01 on Sunday, Wednesday, and Friday
on:
  schedule:
    - cron: '1 12 * * 0,3,5'
  # Run workflow on pushes to main branch
  push:
    branches:
      - main

# Steps to carry out
jobs:
  build:
    # Create a ubuntu virtual machine
    runs-on: ubuntu-latest

    # Checkout repo code
    steps:
    - name: Checkout repo
      uses: actions/checkout@v2

    # Install node
    - name: Use Node.js
      uses: actions/setup-node@v1
      with:
        node-version: 10.16
    - run: npm install
    - run: npm run build --if-present
    - run: npm test
      env:
        CI: true

    # Run script "updateReadme.js" 
    - name: Update README
      run: |-
        node updateReadme.js
        cat README.md

    # Commit changes
    - name: Commit and push if changed
      run: |-
        git diff
        git config --global user.email "readme-bot@example.com"
        git config --global user.name "README-bot"
        git add -A
        git commit -m "Updated articles" || exit 0
        git push
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda