Written by Wim Stockman - on 09 November 2024
An Awk script to generate an Atom feed for my Gemini server by parsing my root index.gmi
you find the awk script here:
=> gemini://yasendfile.org/projects/yagmi2atom/yagmi2atom.awk
The convention for blog/gemlog feeds seems to be Atom+XML, and looking round at the options for generating these i noticed it was easier to implement my own
Since I'm a huge fan of Awk I choose this to parse my root index.gmi file to write out the Atom file
The way the script works.
I choose to skip the first 31 lines
NR < 32 {next;}
they are at the end of my index so if we find this exit.
/EXTERNAL/ {exit;}
the nice thing about awk , exit means: Stop processing and go to the END block. Not exist your script
The list of links are scanned,
/=>/ The link pattern
my links do have a structure, so first the link, then title with description and last update date in format "- dd mmm yyyy"
=> firstentrysecondpost.gmi My first article - 08 Nov 2024
These then get parsed and printed out in the right format.
the date formatting is also done in awk, that is a lovely nice hack.
Enjoy!
text/gemini; lang=en
This content has been proxied by September (3851b).