-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgistgen.sh
executable file
·40 lines (33 loc) · 1013 Bytes
/
gistgen.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env bash
# git clone [email protected]:[target gist shar].git gists-blog
# cd gists-blog
# ./generate.sh
# git add .
# git commit -m "updated links"
# git push
function gistgen_help() {
echo "Usage: $progname <command> [<options>]"
echo "Commands:"
echo " get gist from USER and generate a blog page"
}
function gistgen() {
ACTION="$1"
ACTION_PARAMETER="$2"
case "${ACTION}" in
"get")
gistgen_get "$ACTION_PARAMETER";;
*)
gistgen_help
esac
}
curl -I https://api.github.com/users/[username]/gists | grep link
# for i in $(seq 6); do
# curl 'https://api.github.com/user/2342284/gists?page='$i \
# | jq -r '.[] | "<a href=\"" + .url + "\">" + .description + "</a>" ' > index.html
# done
rm index.md
for i in $(seq 6); do
curl 'https://api.github.com/user/2342284/gists?page='$i \
| jq -r '.[] | .created_at[0:10] + " - [" + .description + "](" + .html_url + ")\n"' >> index.md
done
# Use tinyurl.com to link to your gist