#!/usr/bin/env python3 """load links from a gemini file and output the latest date for each one""" import sys def getnewestdate(url): """load the url, and find the newest date listed in a link""" return '1970-01-01' with open(sys.argv[1]) as f: for line in f: if line[0:2] == '=>': # plz don't use multiple spaces. url = line.split(' ')[1] desc = line[3+len(url):].strip() newestdate = getnewestdate(url) print(f'=> {url} {newestdate} - {desc}')