import re, json, subprocess, html, time B='https://lists.cpunks.org' L='cypherpunks-legacy%40lists.cpunks.org' def get(u): return subprocess.run(['curl','-s','-m','40',u],capture_output=True,text=True).stdout ids=[] for q in ['Hopwood','hopwood%40zetnet.co.uk','david.hopwood']: for p in range(1,30): h=get(f'{B}/archives/search?q={q}&mlist={L}&page={p}') new=re.findall(r'href="(/archives/list/[^"]*/message/[A-Z0-9]+/)"',h) new=[x for x in new if x not in ids] if not new: break ids+=new print('candidates',len(ids),flush=True) out=[] for i,u in enumerate(ids): h=get(B+u) out.append(dict(url=B+u,html=h)) time.sleep(0.2) json.dump(out,open('msgs.json','w')) print('done',len(out))