Last active
October 22, 2024 14:09
-
-
Save dewomser/035557b3eb725504f5852f0f11294e35 to your computer and use it in GitHub Desktop.
Erstellt ein LIste aus GithobRepositories Tags, Beschreibung und Link
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='dewomser' | |
# Hole die Gist-Daten von GitHub API und speichere sie in einer JSON-Datei | |
#curl -L "https://api.github.com/users/$USER/gists" -o gists.json | |
#max 100 | |
#curl --header "Authorization:'token' 'GIST_TOKEN'" -L "https://api.github.com/users/dewomser/gists?per_page=100" -o gists.json | |
#max 200 | |
curl --header "Authorization: 'token' '$GIST_TOKEN'" -L "https://api.github.com/users/dewomser/repos?per_page=100&page=1" -o gits.json | |
#curl --header "Authorization: 'token' '$GIST_TOKEN'" -L "https://api.github.com/users/dewomser/reposs?per_page=100&page=2" -o gits2.json | |
# Beginne die HTML-Liste | |
echo "<ol>" > gits.html | |
# Lese jeden Gist aus der JSON-Datei und füge ihn zur HTML-Liste hinzu | |
# die ersten 100 und die zweiten 100 | |
{ | |
jq -r '.[] | "<li>Topics: \(.topics[0]) <a href=\"\(.html_url)\">\(.description)</a></li>"' gits.json | |
#jq -r '.[] | "<li>opdate:\(.updated_at|split("T")[0]) <a href=\"\(.html_url)\">\(.description)</a></li>"' gits2.json | |
echo "</ol>" | |
} >> gits.html | |
# Beende die HTML-Liste | |
# Lösche die temporären JSON-Datei | |
rm gits.json | |
# … gits2.json | |
# Öffne die erstellte HTML-Datei im Browser (optional) | |
xdg-open gits.html |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment