Last active
January 24, 2026 06:51
-
-
Save dewomser/035557b3eb725504f5852f0f11294e35 to your computer and use it in GitHub Desktop.
Erstellt ein Liste aus Github Repositories Tags, Beschreibung und Link
This file contains hidden or 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 | |
| # Markdown wird geschrieben | |
| cp gits.html gitliste_raw.md | |
| echo "### Gitliste von @dewomser" > gitliste.md | |
| echo "Gemacht mit [git_html.sh](https://gist.github.com/dewomser/035557b3eb725504f5852f0f11294e35)" >> gitliste.md | |
| echo "erstellt am: $(date)" >> gitliste.md | |
| cat gitliste_raw.md >>gitliste.md | |
| # Wenn gist installiert ist, gibts einen automatischen Upload | |
| gist -d "Liste aller meiner Github Einträge. Nach Datum sortiert. Erstellt: $(date)" -u b8ac7218d066ae584601eaac302f47af gitliste.md | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment