// SYNTHETIC XenForo captures for the forum extractor: the forum parser's own // synthetic thread page (social/__fixtures__/xenforoPages.ts), as a live // fetch gets it and as the Wayback Machine's replay serves it (its toolbar // inserted, every same-site URL rewritten to a /web// URL). The forum, // the thread, the members and every word are invented. import { ORIGIN, RICH_BODY, threadPage, type FakePost } from "../../../../social/__fixtures__/xenforoPages"; export { ORIGIN, THREAD_URL } from "../../../../social/__fixtures__/xenforoPages"; const T0 = 1_700_000_000; export const POSTS: FakePost[] = [ { id: 1001, author: "Marigold", userId: 7, ts: T0, position: 21, body: "The blue one is a reproduction.
Look at the glaze." }, { id: 1002, author: "Basil", userId: 8, ts: T0 + 600, position: 22, body: RICH_BODY, editedTs: T0 + 900 }, { id: 1003, author: "Marigold", userId: 7, ts: T0 + 1200, position: 23, body: `Agreed. See the glaze guide.` }, ]; // The thread's page 2, as the forum serves it. export const LIVE_PAGE = threadPage({ page: 2, last: 5, posts: POSTS }); export const CAPTURE_TS = "20240102030405"; // The same page as Wayback's replay serves it. export function replayOf(html: string, ts = CAPTURE_TS): string { const prefix = `/web/${ts}/`; return html .replace(/(href|src)="\/(?!\/)/g, `$1="${prefix}${ORIGIN}/`) .replace(new RegExp(`(href|src|itemid)="${ORIGIN.replace(/\./g, "\\.")}`, "g"), `$1="https://web.archive.org${prefix}${ORIGIN}`) .replace( /]*)>/, `\n\n\n`, ); } export const REPLAY_PAGE = replayOf(LIVE_PAGE); // A captured login wall on the same forum. export const LOGIN_WALL = ` Log in | Example Forum
You must be logged-in to do that.
`;