Created
May 6, 2024 23:28
-
-
Save dewomser/91b38cf433174b605483cc6200dcc51a to your computer and use it in GitHub Desktop.
create a list in html with all yout github repositories
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
## with a little help from copilot | |
# Ersetze 'deinBenutzername' mit deinem GitHub-Benutzernamen | |
USER='deinBenutzername' | |
# Hole die Repository-Daten von GitHub API und speichere sie in einer JSON-Datei | |
curl "https://api.github.com/users/$USER/repos" > repos.json | |
# Beginne die HTML-Liste | |
echo "<ul>" > repos.html | |
# Lese jedes Repository aus der JSON-Datei und füge es zur HTML-Liste hinzu | |
jq -r '.[] | "<li><a href=\"\(.html_url)\">\(.name)</a> - \(.description)</li>"' repos.json >> repos.html | |
# Beende die HTML-Liste | |
echo "</ul>" >> repos.html | |
# Lösche die temporäre JSON-Datei | |
rm repos.json | |
# Öffne die erstellte HTML-Datei im Browser (optional) | |
xdg-open repos.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So sieht das Ergebnis aus:
https://www.untergang.de/index.php/liste-linux/git-liste-bash-und-arduino.html