#!/usr/bin/awk -f ## Converts sfeed(1) files into an Actually Simple Sindication ## (ASS) file. See https://tilde.town/~dzwdz/ass/ for details. ## THE SPEC # An .ass file consists of a bunch of lines. Every line represents an item # (e.g. article). # Every line consists of: # an ISO-8601 formatted date with dashes the URI of the item (optionally) the # title of the item # Those elements are separated by tabs. Every tab after the URI is treated as # part of the title. The order of the lines doesn't matter. Additional # whitespace before the date is NOT permitted. # Lines can also be empty or start with the # character. Those lines are to be # ignored by clients. I recommend adding a comment with a link to this page at # the top, so people won't get confused about what to do with the file. # It's very highly recommended to name the file "feed.ass". This will make feed # discovery much easier. If you want to get added to the list of known feeds, # you MUST name your feed that (the 2 feeds in there are grandfathered in). BEGIN { FS = "\t" OFS = "\t" } { datecmd = "date -u -d '@" ($1 ? $1 : 0) "' +%F" datecmd | getline timestamp close(datecmd) title = $2 link = $3 print timestamp, link, title if (++line > 25) { printf(".") > "/dev/stderr" line = 0 } } END { print("ok") > "/dev/stderr" }