as

Projects / surf

surf

An SEO crawl. The binary is seotool. It scores on-page issues and can batch URLs to JSONL.

Why

I wanted to rerun a crawl after a change and see what moved. A database of pages is the wrong store for that. A JSONL file from last week diffs against a JSONL file from today.

Diagrams

A solid outline is the path in the repo. A dashed outline is the alternative that shape is refusing.

The binary is seotool. It fetches pages, scores on-page HTML, and in batch mode writes one JSON object per URL. Last week’s JSONL diffs against today’s.

flowchart TD
  crawl["seotool"]
  html["On-page HTML score"]
  jsonl["JSONL, one object per URL"]
  diff["Diff against the last file"]
  crawl --> html --> jsonl --> diff
  class crawl,html,jsonl,diff chosen
          

A database of pages is the wrong store for a rerun. slugcheck is the other half: it follows redirects and flags two sitemap URLs that land on one page. That check stays out of the title-length warnings.

flowchart TD
  q{What changed since last week}
  q -->|"line oriented, one object per URL"| jsonl["JSONL diff"]
  q -->|"pages as rows"| db["A page database"]
  url{Two URLs, one final page}
  url -->|"follow redirects first"| slug["slugcheck"]
  url -->|"another on-page warning"| bury["Score it inside surf"]
  class jsonl,slug chosen
  class db,bury rejected
          

Why this shape

The crawler fetches pages, reads the HTML, and scores on-page issues. Batch mode writes one JSON object per URL. The diff is line-oriented because the output is. slugcheck is the other half: surf looks at the page, slugcheck looks at whether two sitemap URLs are the same page after redirects. I kept them separate so a redirect bug does not get buried in a title-length warning.

Where it breaks

It is an on-page crawl. It does not run JavaScript, so a page that fills in its title in the browser looks empty. And a JSONL diff is only as stable as the field order and the URL set. A new query parameter looks like a new page.