Skip to content

About

This is a modern and responsive article-reading website, designed to provide a clean and comfortable reading experience. It allows users to browse various articles, read content in a well-organized layout, and enjoy a simple, user-friendly interface on both desktop and mobile devices.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

📖 PureRead — Clean & Distraction-Free Article Reader

Read the web without the clutter. Paste any public article URL to strip out ads, cookie banners, tracking scripts, and navigation clutter — leaving only pure, readable text.


📸 Screenshots

Homepage

PureRead Homepage

Clean Reader View

PureRead Reader View


✨ Features

  • 🎯 Intelligent Readability Engine: DOM heuristic parser that isolates the main article content, headers, paragraphs, quotes, and images while filtering out sidebars, ads, popups, and cookie consent modals.
  • 🛡️ Advanced SSRF & XSS Security:
    • Validates protocols (strictly http:// and https://).
    • Real-time DNS resolution blocking private IP ranges (RFC 1918), loopbacks (127.0.0.0/8, ::1), link-local subnets (169.254.0.0/16, fe80::/10), carrier NAT (100.64.0.0/10), and cloud metadata services.
    • Safe redirect tracing (up to 5 hops, validating each destination IP).
    • Strict HTML purifier stripping all active scripts, iframes, inline event handlers, and malicious protocols.
    • Enforces rel="noopener noreferrer nofollow" target="_blank" on external links.
  • 🎨 Reading Customization:
    • 4 Reading Themes: Warm Light Paper, Sepia Amber, Slate Dark, and OLED Night.
    • Typography Selector: Serif (Charter / Georgia), Sans-serif (Inter / System), and Monospace (Code).
    • Reading Widths: Narrow (620px), Normal (740px), and Wide (880px).
    • Dynamic Font Resizing: Real-time A+ and A- scaling with instant default reset.
    • Scroll Progress Bar: Subtle indicator at the top of the screen.
  • ⚡ Fast & Lightweight: Zero bloated heavy frameworks. Built with vanilla PHP 8.x, semantic HTML5, modern CSS3, and vanilla JavaScript.
  • 💾 LocalStorage Persistence: Remembers your preferred reading theme, font size, and typography settings across visits.
  • 📋 Export Tools: One-click clean plain text copying and print/PDF stylesheet formatting.
  • 🔒 Privacy-Focused: No user accounts required, zero tracking beacons, and ephemeral short-term caching.
  • 📱 Fully Responsive: Optimized for desktop, tablets, iPhones, and Android browsers.

🛠️ Project Structure

PureRead/
├── app/
│   └── Services/
│       ├── SecurityService.php    # SSRF defense, DNS lookup & IP filtering
│       ├── RateLimiter.php        # File-based sliding window rate limiter
│       ├── FetchService.php       # Safe cURL client with payload limits
│       ├── ArticleExtractor.php   # Heuristic readability & metadata extractor
│       ├── Sanitizer.php          # Strict XSS purifier & tag whitelist
│       └── CacheService.php       # SHA256 hashed file caching with TTL
├── config/
│   └── config.php                 # App settings, timeouts, limits & paths
├── public/
│   ├── index.php                  # Modern homepage & URL submission
│   ├── reader.php                 # Clean reader view & reading controls
│   ├── about.php                  # About PureRead mission & technology
│   ├── how-it-works.php           # Architecture & extraction walkthrough
│   ├── privacy.php                # Privacy policy & data handling notice
│   ├── terms.php                  # Terms of service & legal notices
│   ├── contact.php                # Contact & feedback form
│   ├── robots.txt                 # Search engine crawl rules (noindex reader)
│   ├── sitemap.xml                # SEO sitemap
│   └── assets/
│       ├── css/
│       │   ├── main.css           # Editorial typography & responsive grid
│       │   └── reader.css         # Reader themes, width styles & print CSS
│       ├── js/
│       │   ├── app.js             # Homepage interactions & clipboard paste
│       │   └── reader.js          # Reader toolbar, settings & progress bar
│       └── images/
│           └── favicon.svg        # SVG brand icon
├── screenshots/
│   ├── homepage.png               # Homepage preview screenshot
│   └── reader.png                 # Reader view preview screenshot
├── templates/
│   ├── header.php                 # Shared navigation header
│   ├── footer.php                 # Shared footer
│   └── error_view.php             # Friendly error state template
├── tests/
│   ├── run_tests.php              # Automated unit tests for services
│   ├── ArticleExtractor_Layouts_Test.php # Layout compatibility test suite
│   ├── verify_http.php            # HTTP endpoint verification
│   └── e2e_test.php               # End-to-end extraction test
└── storage/
    ├── cache/                     # Temporary cached article files
    ├── rate_limits/               # Rate limit tracking files
    └── logs/                      # Error & security logs

🚀 How to Set Up & Run

Prerequisites

  • PHP 8.0 or higher (with curl, mbstring, dom, libxml extensions enabled).

Option 1: Quick Start (PHP Built-in Server)

  1. Clone the repository:

    git clone https://github.com/xsazedul/Clean-Article-Reader-Website.git
    cd Clean-Article-Reader-Website
  2. Start the local server:

    php -S 0.0.0.0:8000 -t public
  3. Open in your browser: Navigate to http://localhost:8000


Option 2: Apache / cPanel / Shared Hosting

  1. Upload the project files to your server (e.g. public_html/).
  2. Set your web server's Document Root to the public/ directory (recommended for security so /app, /config, and /storage are outside the public web root).
  3. Ensure the storage/ directory is writable:
    chmod -R 755 storage/
  4. Access your domain in any web browser.

Option 3: Nginx Configuration

server {
    listen 80;
    server_name yourdomain.com;
    root /path/to/Clean-Article-Reader-Website/public;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location ~ \.php$ {
        include fastcgi_params;
        fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location ~ /\.(ht|git) {
        deny all;
    }
}

📖 How to Use PureRead

  1. Copy an Article URL: Find any publicly accessible article, blog post, or news story on the web.
  2. Paste & Clean:
    • Open the PureRead homepage.
    • Click Paste (or press Ctrl+V) into the large URL input.
    • Click Clean Article (or press Enter).
  3. Customize Your Reading Experience:
    • Themes: Click the color dots in the top toolbar to switch between Light, Sepia, Slate Dark, or OLED Night.
    • Font: Change typography between Serif, Sans, or Mono.
    • Size: Use A+ or A- to scale the font size to your comfort.
    • Width: Select Narrow, Normal, or Wide layout.
  4. Copy & Print:
    • Click Copy Clean Text in the bottom action bar to copy the purified text to your clipboard.
    • Click Print / PDF to print or save the article as a clean PDF without browser clutter.

🧪 Running Automated Tests

PureRead includes an automated test suite covering security, layout extraction, XSS sanitization, rate limiting, and HTTP response handling.

Run the test suite from the project root:

# Run core unit and security tests
php tests/run_tests.php

# Run layout compatibility tests (WordPress, News, JSON-LD, Semantic HTML)
php tests/ArticleExtractor_Layouts_Test.php

# Verify live HTTP endpoints
php tests/verify_http.php

⚙️ Configuration

Application settings can be configured in config/config.php:

Option Default Description
fetch.timeout_seconds 10 Maximum network request timeout
fetch.max_response_bytes 5242880 (5MB) Maximum downloadable payload limit
fetch.max_redirects 5 Maximum redirects followed
rate_limit.enabled true Enable/disable IP rate limiting
rate_limit.max_requests 30 Max requests per IP window
rate_limit.window_seconds 60 Sliding rate limit window (seconds)
cache.enabled true Enable/disable file caching
cache.ttl_seconds 21600 (6h) Cache lifespan before eviction

⚖️ Content & Copyright Ethics

PureRead is designed for personal reading accessibility of publicly available content. It does not bypass paywalls, login gates, or access-controlled systems. Original authors and publishers are credited on every reader page with a direct link to the canonical source URL.


📄 License

This project is licensed under the MIT License.

About

This is a modern and responsive article-reading website, designed to provide a clean and comfortable reading experience. It allows users to browse various articles, read content in a well-organized layout, and enjoy a simple, user-friendly interface on both desktop and mobile devices.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages