Skip to content

feat: WebPage to Plain Text Converter - #1

Draft
kncker wants to merge 2 commits into
mainfrom
claude/funny-volta-ptjkdk
Draft

feat: WebPage to Plain Text Converter#1
kncker wants to merge 2 commits into
mainfrom
claude/funny-volta-ptjkdk

Conversation

@kncker

@kncker kncker commented Jun 25, 2026

Copy link
Copy Markdown
Owner

Summary

  • Node.js/Express backend that fetches URLs server-side (bypassing CORS), parses HTML with Cheerio, and returns clean plain text via POST /api/convert
  • Single-page Tailwind CSS frontend with URL input, boilerplate exclusion toggle, live spinner, word count, copy-all and copy-selected with 2-second visual feedback
  • Full error handling for invalid URLs, HTTP errors, and timeouts

What's included

File Purpose
server.js Express API — fetches, strips, and cleans HTML
public/index.html Frontend SPA with Tailwind CDN + Vanilla JS
package.json Dependencies: express, axios, cheerio, cors
README.md Local run + deploy instructions for Render/Heroku/Vercel

Processing pipeline

  1. Fetch with a real browser User-Agent + 10s timeout
  2. Strip <script>, <style>, <noscript>, <iframe>, <svg>, forms, inputs, buttons
  3. (If boilerplate excluded) Remove <header>, <footer>, <nav>, <aside> + divs/sections whose id/class matches nav/menu/sidebar/footer patterns; prefer <main>/<article> content
  4. Normalize whitespace: collapse inline spaces, filter blank lines, rejoin with \n\n paragraph breaks

Test plan

  • npm install && npm start → server at http://localhost:3000
  • Enter a URL and click "Convert to Text" — plain text appears
  • Toggle "Exclude boilerplate" off/on to compare output
  • "Copy ALL Text" copies full textarea content
  • Select text in textarea → "Copy Selected Text" copies selection
  • Both copy buttons show "Copied!" for 2 seconds
  • Invalid URL shows user-friendly error message
  • Slow/unreachable URL shows timeout message

🤖 Generated with Claude Code

https://claude.ai/code/session_01SMHiyyJcKy2YuYL81RA4y2


Generated by Claude Code

claude added 2 commits June 25, 2026 08:48
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SMHiyyJcKy2YuYL81RA4y2
Replace single URL input with a multi-line textarea (one URL per line,
up to 25). New /api/convert-bulk endpoint processes all URLs in parallel
via Promise.all and returns per-URL results. Frontend renders a tab per
URL showing individual word count, copy-all, copy-selected, and error
state. Counter and over-limit warning update live as URLs are typed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SMHiyyJcKy2YuYL81RA4y2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants