Feed date scraper for Gemini (protocol)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/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}')