Skip to content

Commit 8933a3a

Browse files
committed
Strip Listserv macros and fix broken URLs in backfilled newsletters
- Add TICKET_URL pattern to remove_sdc_line for Listserv footer cleanup - Add TICKET_URL footer marker to clean_newsletter.py - Fix broken YouTube URL in 13.04 - Re-import all 6 newsletters with clean output
1 parent dec0496 commit 8933a3a

File tree

8 files changed

+9
-18
lines changed

8 files changed

+9
-18
lines changed

_newsletters/13.01-welcome-back-2-2-24/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,5 +465,3 @@ Alain
465465
***************************************************************************************************************
466466

467467
This list is maintained by [Alain Kornhauser](mailto:alaink@princeton.edu) and hosted by the [Princeton University LISTSERV](http://lists.princeton.edu).
468-
469-
[Unsubscribe](&*TICKET_URL(SMARTDRIVINGCARS,SIGNOFF);) | [Re-subscribe](&*TICKET_URL(SMARTDRIVINGCARS,SIGNUP);)

_newsletters/13.02-last-dispatcher-2-25-25/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -528,5 +528,3 @@ Alain
528528
***************************************************************************************************************
529529

530530
This list is maintained by [Alain Kornhauser](mailto:alaink@princeton.edu) and hosted by the [Princeton University LISTSERV](http://lists.princeton.edu).
531-
532-
[Unsubscribe](&*TICKET_URL(SMARTDRIVINGCARS,SIGNOFF);) | [Re-subscribe](&*TICKET_URL(SMARTDRIVINGCARS,SIGNUP);)

_newsletters/13.03-may-2025-5-04-25/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -527,5 +527,3 @@ F.
527527
***************************************************************************************************************
528528

529529
This list is maintained by [Alain Kornhauser](mailto:alaink@princeton.edu) and hosted by the [Princeton University LISTSERV](http://lists.princeton.edu).
530-
531-
[Unsubscribe](&*TICKET_URL(SMARTDRIVINGCARS,SIGNOFF);) | [Re-subscribe](&*TICKET_URL(SMARTDRIVINGCARS,SIGNUP);)

_newsletters/13.04-birthdaypresent-5-29-25/index.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,7 @@ F.
251251
informative to watch Rob report it live.
252252
 Alain
253253

254-
[](https://www.youtube.com/playlist?list=PLFwuZ9jMeu5uwfTZP00zHjP7eSpG34Hsm)[SmartDrivingCars ZoomCasts](https!
255-
://www.youtube.com/playlist?list=PLFwuZ9jMeu5uwfTZP00zHjP7eSpG34Hsm)
254+
[SmartDrivingCars ZoomCasts](https://www.youtube.com/playlist?list=PLFwuZ9jMeu5uwfTZP00zHjP7eSpG34Hsm)
256255

257256
 [Farmers fuming over California's
258257
ban on driverless tractors, other robots](https://www.nbcbayarea.com/news/local/autonomous-farming-agriculture-equipment-california/3878319/)
@@ -737,5 +736,3 @@ Alain
737736
***************************************************************************************************************
738737

739738
This list is maintained by [Alain Kornhauser](mailto:alaink@princeton.edu) and hosted by the [Princeton University LISTSERV](http://lists.princeton.edu).
740-
741-
[Unsubscribe](&*TICKET_URL(SMARTDRIVINGCARS,SIGNOFF);) | [Re-subscribe](&*TICKET_URL(SMARTDRIVINGCARS,SIGNUP);)

_newsletters/13.05-d-day81-6-6-25/index.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -352,5 +352,3 @@ We had an excellent class this Fall.  This is a compilation of their investigat
352352
***************************************************************************************************************
353353

354354
This list is maintained by [Alain Kornhauser](mailto:alaink@princeton.edu) and hosted by the [Princeton University LISTSERV](http://lists.princeton.edu).
355-
356-
[Unsubscribe](&*TICKET_URL(SMARTDRIVINGCARS,SIGNOFF);) | [Re-subscribe](&*TICKET_URL(SMARTDRIVINGCARS,SIGNUP);)

_newsletters/13.06-ID.Buzz-6.19.25/index.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
layout: newsletter
3-
title: "2026-03-09"
4-
date: 2026-03-09
3+
title: "2025-06-21"
4+
date: 2025-06-21
55
permalink: /13.06-ID.Buzz-6.19.25/
6-
display_name: "13.06 ID.Buzz"
6+
display_name: "13.06 - Id.Buzz"
77
---
88

99
June 19, 2025
@@ -255,5 +255,3 @@ Hmmmm…
255255
***************************************************************************************************************
256256

257257
This list is maintained by [Alain Kornhauser](mailto:alaink@princeton.edu) and hosted by the [Princeton University LISTSERV](http://lists.princeton.edu).
258-
259-
[Unsubscribe](&*TICKET_URL(SMARTDRIVINGCARS,SIGNOFF);) | [Re-subscribe](&*TICKET_URL(SMARTDRIVINGCARS,SIGNUP);)

scripts/clean_newsletter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,8 @@ def clean_newsletter_html(input_html: str) -> str:
8686
footer_markers = [
8787
re.compile(r'^\*{5,}$'),
8888
re.compile(r'^\s*This list is maintained by', re.IGNORECASE),
89-
re.compile(r'^\s*To unsubscribe from this list', re.IGNORECASE)
89+
re.compile(r'^\s*To unsubscribe from this list', re.IGNORECASE),
90+
re.compile(r'TICKET_URL\(', re.IGNORECASE),
9091
]
9192
elements_to_remove = []
9293
footer_found = False

scripts/import_newsletter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ def remove_sdc_line(text):
157157
# Remove any line that links to smartdrivingcar.com (markdown or HTML)
158158
if re.search(r'(\[.*?\]\(https?://smartdrivingcar\.com.*?\))|(<a[^>]*href=["\']https?://smartdrivingcar\.com.*?>.*?</a>)|smartdrivingcar\.com', line, re.IGNORECASE):
159159
continue
160+
# Remove Listserv macro lines (unsubscribe/subscribe ticket URLs)
161+
if re.search(r'TICKET_URL\(', line):
162+
continue
160163
new_lines.append(line)
161164
return '\n'.join(new_lines)
162165

0 commit comments

Comments
 (0)