💾 Archived View for tilde.club › ~oldernow › 2023-11-30-10-57-16.gmi captured on 2023-12-28 at 17:17:08. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
I've been enjoying - when not suffering at the hands of my own stupidity - messing with scripting to create versions of Gemini pages showing dead links. It's far from perfect, but mostly does what I need it to do. Much thanks to @skyjake for the insights!
This script that I call test-gemini-links (the name is inadequate, but you know how script evolution can take code past initial naming...) does the medium lifting. It depends on 'gemget' and 'curl':
#! /usr/bin/env lua if arg[1] then local connect_timeout = 3 local errfile = '/tmp/errmsg' local handle = nil if os.getenv('FILE') then handle = io.open(arg[1], 'r') else handle = io.popen('gemget ' .. arg[1]) end for line in handle:lines() do local url,title = string.match(line, '^=>%s*(%S*)%s*(.*)