Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

78
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!