Random Site Summary — Story Explorer

Loaded SRC_URL

https://producingtechnology.com/65-apps/huangxinyi_183473_15200446_story_explorer.html

Summary of Behavior

Story Explorer is a single-file HTML app that fetches a JSON file (from producingtechnology.com/a1/15-json/) and re-renders its content as a magazine-style article. It expects a Wikipedia-style parse response — it reads data.parse.text["*"], parses the embedded HTML with DOMParser, and scrapes the .mw-parser-output subtree for paragraphs, h2/h3 headings, and table.infobox rows.

The interface has two panels:

Extra niceties: pressing Enter in the URL field triggers loading, and a ?json= query parameter auto-loads on page open. The visual style is warm and editorial — cream background, serif Georgia body, burnt-orange accent.

Things That Didn't Work as Expected

Prompt to Improve the App

Refactor Story Explorer so it's format-agnostic and friendlier on first use. Specifically:

  1. Replace the misnamed "Use My Link Later" button with "Try Sample", wired to a known-good JSON URL so a new visitor can see the full UI in one click.
  2. Add a drag-and-drop / file-picker zone next to the URL input so users can load a local .json file without hosting it.
  3. Generalize getHtmlFromJson and getParagraphs: if no MediaWiki parse.text["*"] is present, walk arbitrary JSON and render string leaves as paragraphs, with object keys as section headings. Show a small "detected format" badge (Wikipedia / Generic JSON / Plain HTML).
  4. Rename "Highlights" to "At a glance" and compute real highlights when no infobox exists — top-five most frequent proper nouns or capitalized bigrams, plus an estimated reading time (words / 225).
  5. Persist the last-used URL and a recent-URLs dropdown in localStorage, and update history.replaceState with ?json= after each successful load so the URL can be shared.
  6. Add an "Export as Markdown" button that downloads the rendered story (title, intro, pull quote, chapter previews) as a .md file.
  7. On fetch failure, distinguish the error: CORS / 404 / invalid JSON / wrong shape — currently they all collapse to the same red message.
  8. Keep the single-file, no-dependency constraint, and preserve the current typographic palette.