💾 Archived View for tilde.team › ~steve › script_example.gmi captured on 2023-05-24 at 19:31:26. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-12-03)
-=-=-=-=-=-=-
Below is my simple comments cgi script. It just appends a user's input to a given file.
#!/bin/sh if [ -z $QUERY_STRING ]; then printf "10 Please enter your comment and name: \r\n" fi decoded=`echo $QUERY_STRING | perl -pe 's/\%(\w\w)/chr hex $1/ge'` echo "\n"$decoded >> ../guestbook.gmi # too much empty lines between comments sed -i -z -e 's/\n\{4,\}/\n\n\n/g' ../guestbook.gmi printf "30 ../guestbook.gmi\r\n"