| 1 | #!/usr/bin/env python3 |
| 2 | import subprocess |
| 3 | from pathlib import Path |
| 4 | |
| 5 | from scrape_bookmarks import clean_markdown |
| 6 | |
| 7 | |
| 8 | ROOT = Path(__file__).resolve().parent |
| 9 | pages = { |
| 10 | "0036-rooming-house-new-property-australia.md": "https://newproperty.com.au/property-types/rooming-house/", |
| 11 | "0037-a-guide-to-single-tenant-vs-multi-tenant-commercial-real-estate-faqs-answered-binary-stream.md": "https://binarystream.com/a-guide-to-single-tenant-vs-multi-tenant-commercial-real-estate-faqs-answered/", |
| 12 | } |
| 13 | |
| 14 | for filename, url in pages.items(): |
| 15 | result = subprocess.run(["w3m", "-dump", "-T", "text/html", url], check=False, capture_output=True, text=True) |
| 16 | if result.returncode != 0 or len(result.stdout.strip()) < 300: |
| 17 | print(f"No fallback content for {filename}") |
| 18 | continue |
| 19 | title = filename[5:-3].replace("-", " ").title() |
| 20 | (ROOT / "property-pages" / filename).write_text(clean_markdown(result.stdout, title), encoding="utf-8") |
| 21 | print(f"Recovered {filename}") |