Yet Another Gemini 2 Atom feed generator
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:
Gmi based feed generator
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
Automatic feed generation
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.
- 1. First it skips the headers of my index.gmi file.
I choose to skip the first 31 lines
NR < 32 {next;}
- 2. Also the external capsules shouldn't be in the Atom feed.
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
- 3. Scan the Links
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!