Join Nostr
2026-05-13 03:38:21 UTC

mattn on Nostr: /run py import re import sys import urllib.request URL = "" if len(sys.argv) > 1: ym ...

/run py
import re
import sys
import urllib.request

URL = "https://fushinsha-joho.co.jp/serif.cgi";

if len(sys.argv) > 1:
ym = sys.argv[1]
url = f"{url}?ym={ym}"

with urllib.request.urlopen(url) as r:
html = r.read().decode("utf-8")

pattern = re.compile(
r'<a[^>]*class="headline"[^>]*>.*?<div[^>]*>\s*(.*?)\s*</div>\s*</a>',
re.DOTALL,
)
for m in pattern.finditer(html):
line = re.sub(r"\s+", "", m.group(1))
print(line)