From aaa3306a1b9e440c4adf9e54fcfd204243b54404 Mon Sep 17 00:00:00 2001 From: Christian Krinitsin Date: Sun, 18 May 2025 16:34:41 +0200 Subject: mailinglist: iterate through all months and print url --- mailinglist/downloader.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 mailinglist/downloader.py (limited to 'mailinglist/downloader.py') diff --git a/mailinglist/downloader.py b/mailinglist/downloader.py new file mode 100755 index 00000000..21452890 --- /dev/null +++ b/mailinglist/downloader.py @@ -0,0 +1,21 @@ +from datetime import datetime, timedelta + +end_date = datetime(2003, 4, 1) +start_date = datetime.today().replace(day=1) + +def months_iterator(start, end): + current = start + while current >= end: + yield current + if current.month == 1: + current = current.replace(year=current.year - 1, month=12) + else: + current = current.replace(month=current.month - 1) + +def main(): + for month in months_iterator(start = start_date, end = end_date): + url = f"https://lists.nongnu.org/archive/html/qemu-devel/{month.strftime("%Y-%m")}/threads.html" + print(url) + +if __name__ == "__main__": + main() -- cgit 1.4.1