Skip to content

Instantly share code, notes, and snippets.

@dewomser
Last active May 7, 2024 00:08
Show Gist options
  • Save dewomser/acf0590d38ae86343a062c580e252902 to your computer and use it in GitHub Desktop.
Save dewomser/acf0590d38ae86343a062c580e252902 to your computer and use it in GitHub Desktop.
Make a html Linklist from all your Github Gists
#!/bin/bash
## with a little help from copilot
# Ersetze 'deinBenutzername' mit deinem GitHub-Benutzernamen
USER='deinBenutzername'
# Hole die Gist-Daten von GitHub API und speichere sie in einer JSON-Datei
curl "https://api.github.com/users/$USER/gists" > gists.json
# Beginne die HTML-Liste
echo "<ul>" > gists.html
# Lese jeden Gist aus der JSON-Datei und füge ihn zur HTML-Liste hinzu
jq -r '.[] | "<li><a href=\"\(.html_url)\">\(.description)</a></li>"' gists.json >> gists.html
# Beende die HTML-Liste
echo "</ul>" >> gists.html
# Lösche die temporäre JSON-Datei
rm gists.json
# Öffne die erstellte HTML-Datei im Browser (optional)
xdg-open gists.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment