DragonRster`s Void
Banner Image
On This Page
May 2026 · What I'm Working On

Statistics, emoticons, and optimizations


Visitor statistics

  • ASCII heatmap & world map
  • At the end of April I decided to add a statistics page. It started as an hourly heatmap and then grew into daily charts, monthly trends, crawler sources, and visitor loyalty tracking.

    The ASCII world map uses the DB-IP free city-level database (8 million rows). Visitor IPs are parsed into coordinates, then density characters are drawn onto map.txt. Mainland China, North America, and Europe all cluster in different regions, with dense areas using # and @.

    The stats page also includes a UA archaeology panel for old browsers recorded in the logs.

  • Server monitoring
  • I added psutil for CPU, memory, disk, and uptime. If psutil is unavailable, a ctypes fallback is used. The stats page now shows live server status without SSHing into the box.

    Guestbook emoticon system

  • Pixel-art GIF emoticons
  • The guestbook now has 20 pixel-art emoticons. Click the bottom panel to open the list, or type [em01] through [em20] manually. Stored values are codes, and both the page and email render them as images.

    The emoticon panel does not preload images by default; it is generated lazily so the initial page load saves 20 HTTP requests.

  • Compact form layout
  • The guestbook form moved from scattered label/input elements into a single HTML table. Name, Email, Content, Show IP, and Submit all fit inside a 125px wide cell. The emoticon panel collapses to save space, and 1px borders replace the default 2px look.

    Mail system improvements

  • Asynchronous background sending
  • Reply emails were previously sent synchronously, forcing users to wait for the message to send. Now mailer.py runs as a separate process and sends email in the background via stdin.

  • Emoticon rendering in emails
  • Guestbook messages with codes like [em07] are now converted to <img> tags pointing to server-hosted GIFs, so email recipients also see the animated emoticons.

    Logging refactor

  • Centralized log management
  • The site logs are now consolidated under data/logs/:

    
    data/logs/
    ├── access/          ← access logs (.log per day, old logs .gz compressed)
    ├── guestbook.log    ← guestbook operations and SMTP status
    ├── editor.log       ← editor actions and auth events
    ├── search.log       ← search query keywords and result counts
    ├── toolbox.log      ← tool usage records
    ├── build.log        ← build actions
    └── error.log        ← cross-module errors
    

    A shared logger.py module now powers all CGI scripts, so logs are classified consistently.

    Performance optimizations

  • External badge images now use loading="lazy".
  • The 20 emoticon GIFs also use loading="lazy", reducing initial requests.
  • Header includes preconnect hints for external domains.
  • The comment area in the sidebar is locked to 700px width to prevent layout breakage.
  • Other small improvements

  • The web server now uses whitelist routing and returns 403 for sensitive directories like data/, scripts/, and src/.
  • The whole site now includes to avoid Quirks Mode.
  • editor.py added audit logging for who edited what and when.
  • The build cache now uses MD5 content hashing so component changes correctly trigger rebuilds.
  • The blog editor, search engine, and toolbox all log through the shared logger.
  • README was updated with notes for the new features.

  • —— Written on May 2, 2026. Happy Labor Day!

    « The Hakimi Chronicles « Home
    Tools
    中文   [Toolbox]

    Latest Posts

    » May 2026 ·...
    » The Hakimi...
    » Site Frame...
    » Script Dee...
    » Script Dee...

    » Article Archive

    Tags

    Daily Changelog Site Building

    DRAGONRSTER
    CC BY-NC-SA
    © 2004-2026 DragonRster • Made with HTML • 本站支持IE5.5+
    最佳浏览分辨率:1024x768 • 本页最后更新于 2026年05月03日 02:19:00