A story
Words.
// The site-extractor registry: each synthetic capture goes to the extractor // made for it, an unknown page to none (the generic extractor's), and every // extractor is pure — the same input gives the same drafts, and the input is // left as it was. // // Run with: pnpm --filter yt-dlp-transcript-common exec tsx --test lib/waybackPages/extractors/index.test.ts import { test } from "node:test"; import assert from "node:assert/strict"; import { SITE_EXTRACTORS } from "./index"; import { PAGE_KINDS } from "../types"; import { captureOf, fixture } from "./__fixtures__/capture"; import { LIVE_PAGE, LOGIN_WALL, REPLAY_PAGE, THREAD_URL } from "./__fixtures__/xenforoCaptures"; const GDOC = "https://docs.google.com/document/d/1AbCdEfGhIjKlMnOpQrStUvWxYz0123456789"; const CASES: [html: string, url: string, expected: string | null][] = [ [fixture("tumblr-2012-classic-post.html"), "http://teapot-notes.tumblr.com/post/20000000001/on-spouts", "tumblr"], [fixture("tumblr-2012-classic-index.html"), "http://teapot-notes.tumblr.com/", "tumblr"], [fixture("tumblr-2014-article-index.html"), "http://blog.kettle-studio.example/page/2", "tumblr"], [fixture("tumblr-minimal-tagged.html"), "http://quiet-kettle.tumblr.com/tagged/steam", "tumblr"], [fixture("x-2015-profile.html"), "https://twitter.com/TeapotFan", "x"], [fixture("x-2012-profile.html"), "https://twitter.com/kettlefriend", "x"], [fixture("x-2016-status.html"), "https://twitter.com/TeapotFan/status/697374449464250369", "x"], [fixture("x-mobile-profile.html"), "https://mobile.twitter.com/TeapotFan", "x"], [fixture("x-2022-shell.html"), "https://x.com/TeapotFan", "x"], [LIVE_PAGE, `${THREAD_URL}page-2`, "xenforo"], [REPLAY_PAGE, `${THREAD_URL}page-2`, "xenforo"], [LOGIN_WALL, `${THREAD_URL}page-2`, "xenforo"], [fixture("gdoc-mobilebasic.html"), `${GDOC}/mobilebasic`, "gdoc"], [fixture("gdoc-pub.html"), "https://docs.google.com/document/d/e/2PACX-1vTeapot/pub?embedded=true", "gdoc"], [fixture("gdoc-edit-shell.html"), `${GDOC}/edit`, "gdoc"], [fixture("yt-about-2013.html"), "http://www.youtube.com/user/teapotchannel/about", "yt-about"], [fixture("yt-about-2019-polymer.html"), "https://www.youtube.com/channel/UCteapot0000000000000001/about", "yt-about"], [fixture("yt-channel-2021.html"), "https://www.youtube.com/c/TeapotChannel", "yt-about"], [fixture("yt-about-2024-handle.html"), "https://www.youtube.com/@TeapotChannel/about", "yt-about"], [fixture("ng-user-2014.html"), "http://pocketfox.newgrounds.com/", "newgrounds"], [fixture("ng-user-2010.html"), "http://pocketfox.newgrounds.com/", "newgrounds"], [fixture("ng-art-2014.html"), "http://www.newgrounds.com/art/view/pocketfox/lighthouse-at-dusk", "newgrounds"], [fixture("ng-movie-2014.html"), "http://www.newgrounds.com/portal/view/634512", "newgrounds"], // Pages no site extractor claims: an article, a personal site, a video page. [`
Words.