x-article-reader
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v159View latest version
A clean, distraction-free reader for X.com (Twitter) article threads. Built for Val Town.
- Clean reading experience — Renders X.com articles in a minimal, readable format
- Syntax highlighting — Code blocks are highlighted using highlight.js
- OpenGraph support — Proper meta tags for link previews
- Caching — Articles are cached in SQLite for 24 hours to reduce API calls
- URL rewriting — Simply replace
x.comwithx-reader.val.runin any article URL
- Visit the homepage
- Paste an X.com article URL (e.g.,
https://x.com/user/status/123456) - Click "Read" to view the article
Replace x.com in any article URL with x-reader.val.run:
https://x.com/username/status/123456
→
https://x-reader.val.run/username/status/123456
backend/
├── index.ts # Hono app entry point
├── api/
│ └── fxtwitter.ts # FXTwitter API client
├── database/
│ ├── migrations.ts # SQLite schema
│ └── queries.ts # Cache operations
├── renderer/
│ └── article.ts # Draft.js → HTML renderer
├── routes/
│ └── article.ts # Article route handler
└── templates/
├── article.ts # Article page template
└── error.ts # Error page template
frontend/
├── index.html # Homepage
└── style.css # Styles
shared/
├── types.ts # TypeScript types
└── utils.ts # Shared utilities
- User provides an X.com article URL
- The app fetches article data from the FXTwitter API
- Article content (in Draft.js format) is parsed and rendered to HTML
- The rendered article is cached in SQLite for 24 hours
- The clean HTML page is served to the user
This is a Val Town project. Use the vt CLI for local development:
# Install dependencies npm install # Push to Val Town vt push
- Only supports X.com "article" posts (long-form threads with the article format)
- Regular tweets/threads are not supported
- Private accounts and deleted posts cannot be accessed