···11+#!/bin/bash
22+#
33+# unfinished weird little thing i was playing with to query the marvel API
44+55+API_KEY=x
66+PRIV_KEY=x
77+TS=1
88+HASH=$(echo -n ${TS}${PRIV_KEY}${API_KEY} | md5sum | cut -d ' ' -f 1)
99+1010+echo -e "what do you want to look up? \n"
1111+1212+CHOOSE=$(gum choose --limit 1 "characters" "comics" "creators")
1313+1414+echo -e "what do you want to look up from ${CHOOSE}? \n"
1515+1616+LOOK=$(gum input --placeholder "type away")
1717+1818+URL="https://gateway.marvel.com/v1/public/${CHOOSE}?${TYPE}=${LOOK}&apikey=${API_KEY}&ts=${TS}&hash=${HASH}"
1919+2020+if [ "${CHOOSE}" == "characters" ]; then
2121+ echo -e "pick from below \n"
2222+ TYPE="name"
2323+ CHARA=$(gum choose --limit 1 "comics" "series" "events")
2424+ case ${CHARA} in
2525+ comics)
2626+ echo -n -e "comics starring ${LOOK}: \n\n"
2727+ curl -s ${URL} | jq -r ".data.results[].comics.items[].name"
2828+ ;;
2929+ series)
3030+ echo -n -e "series starring ${LOOK}: \n\n"
3131+ curl -s ${URL} | jq -r ".data.results[].series.items[].name"
3232+ ;;
3333+ events)
3434+ echo -n -e "events starring ${LOOK}: \n\n"
3535+ curl -s ${URL} | jq -r ".data.results[].events.items[].name"
3636+ ;;
3737+ esac
3838+elif [ "$CHOOSE" == "comics" ]; then
3939+ echo -e "pick from below \n"
4040+ TYPE="title"
4141+ COMIC=$(gum choose --limit 1 "title" "description")
4242+ case ${COMIC} in
4343+ title)
4444+ echo -n -e "comics featuring ${LOOK}: \n\n"
4545+ curl -s ${URL} | jq -r ".data.results[].title"
4646+ ;;
4747+ description)
4848+ echo -n -e "comic descriptions with ${LOOK}: \n\n"
4949+ curl -s ${URL} | jq -r ".data.results[].description"
5050+ ;;
5151+ esac
5252+else
5353+ echo -e "did you hit ctrl+c"
5454+fi
+13
md2html
···11+#!/bin/bash
22+#
33+# generates an HTML file from a supplied MD file in the current working directory
44+#
55+# uses a custom pandoc template
66+77+FILE=$(gum input --placeholder "without an extension")
88+99+HTML="pandoc/md2html.html"
1010+1111+CSS="pandoc/md2html.css"
1212+1313+pandoc --standalone "$FILE.md" --template=$HTML --no-highlight -o "$FILE.html"