💾 Archived View for krauserd.xyz › src › entry.gmi captured on 2023-01-29 at 02:15:09. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-03-01)

➡️ Next capture (2023-05-24)

-=-=-=-=-=-=-

David Krauser's Gemini Capsule

gemini://krauserd.xyz

Entry View Source Code

This Gemini capsule is somewhat dynamic. It has a user visit count, and each page is generated on-the-fly from files on disk. These are the hacky bits that make the log entry pages:


#!/bin/sh
log=$QUERY_STRING.gmi

if [ ! -f "$log" ]; then
  /usr/bin/echo -ne '51 Not found\r\n'
  exit 0
fi

echo -n 1 >> ../count
sed 3q ../header.gmi | unix2dos
/usr/bin/echo -ne '\r\n\r\n'
sed 1q $log | unix2dos
timestamp=$(sed '1d;2q' $log)
/usr/bin/echo -ne '=> gemini://krauserd.xyz/logs/index.gmi?'${log%%.gmi}' '$timestamp' ∞\r\n'
sed 1,2d $log | unix2dos
/usr/bin/echo -ne '\r\n\r\n'
/usr/bin/echo -ne '=> gemini://krauserd.xyz/src/entry.gmi Source code for this page\r\n'
unix2dos < ../footer.gmi

Licensed under CC BY-SA 4.0