Show HN:一款带有集成待办/已完成追踪功能的原生 Hacker News 阅读器
Show HN: A native Hacker News reader with integrated todo/done tracking

原始链接: https://github.com/haojiang99/hacker_news_reader

这是一个用Rust和egui构建的Hacker News原生桌面应用程序,提供了一个简洁现代的界面,用于浏览热门、最新、Show HN、Ask HN、招聘和最佳等各个板块。它显示的故事包含颜色编码的分数、作者、域名和评论数。用户可以在浏览器中打开文章,并以类似Reddit的线程化格式查看评论,该格式具有自动折叠、可调节字体大小和作者高亮显示功能。 主要功能包括深色/浅色模式、离线缓存和带有本地存储的收藏夹系统。导航直观,具有标签切换、键盘快捷键和用于从评论视图返回的返回按钮。搜索界面允许按标题、域名或作者进行筛选。故事会在您滚动时自动加载。 该应用程序使用三个主要组件构建:使用`egui`的UI层、定义故事和评论的数据模型以及负责从Hacker News获取和解析数据的`hn_client`模块。

Coolwulf分享了他用Rust和egui构建的“Show HN: 一个原生Hacker News阅读器”。由于管理HN帖子感到沮丧,Coolwulf创建了一个工具,可以高效地浏览HN各个板块,将帖子标记为“待办”和“已完成”,并过滤内容。 主要功能包括集成的待办事项跟踪、搜索、多个板块(热门、最新等)、线程评论、深色/浅色模式、键盘快捷键、自动加载、颜色编码和原生应用性能。该应用抓取HN HTML并使用SQLite进行本地存储,提供离线功能。 该项目是开源的(MIT许可证),可在GitHub上找到(github.com/haojiang99/hacker_news_reader)。用户指出了一个失效链接,并赞赏该项目注重易用性和可读性,包括潜在的基于LLM的摘要功能。Coolwulf回答了关于RSS阅读器替代方案的问题,指出其定制能力超越了RSS。该工具旨在通过跟踪功能改进HN阅读工作流程,激发进一步开发和用户贡献的兴趣。
相关文章

原文

A native desktop application for browsing Hacker News with a clean, modern interface. Built with Rust and egui.

Hacker News Reader Logo

Hacker News Reader Screenshot

  • Browse top stories from different Hacker News sections:
    • Hot Stories (front page)
    • New Stories
    • Show HN
    • Ask HN
    • Jobs
    • Best Stories
  • View comments in a threaded, Reddit-like format with auto-folding and adjustable font size
  • Search and filter stories by title, domain, or author
  • Automatically loads more content when scrolling to the bottom
  • Color-coded stories based on score
  • Dark and light mode support
  • Offline capability with local caching
  • Favorite stories for later reading
  • Open articles in your default browser
  • Rust (1.70.0 or newer)
  • Cargo package manager
  1. Clone the repository:

    git clone <repository-url>
    cd hacker_news_reader
  2. Build the application:

  3. Run the application:

The compiled binary will be available at target/release/hacker_news_reader.

  • Tabs: Click the tabs at the top to switch between different Hacker News sections (Hot, New, Show, Ask, Jobs, Best).
  • Stories: Click on a story title to open it in your default web browser.
  • Comments: Click on the comments count to view the comments for a story.
  • Back: Use the back button or press Backspace to return to the story list from comments view.
  • Refresh: Click the refresh button to reload the current section. Hold Shift while clicking to bypass the cache.
  • Theme: Toggle between dark and light themes using the theme button.
  • Favorites: Click the hamburger menu (☰) to show or hide your favorite stories.
  • Arrow Keys: Use arrow keys to scroll.
  • Space / Page Down: Scroll down a page.
  • Page Up: Scroll up a page.
  • Home: Scroll to the top.
  • End: Scroll to the bottom.
  • Backspace: Return to the story list from the comments view.
  • C: When viewing comments, collapse all top-level comments.
  • Shift+C: When viewing comments, expand all comments.
  • + (Plus): Increase comment font size when in comments view.
  • - (Minus): Decrease comment font size when in comments view.
  • Ctrl+F: Show search interface to filter stories.
  • Escape: Close search interface.
  • 1-6 Number Keys: Switch between tabs (1=Hot, 2=New, 3=Show, 4=Ask, 5=Jobs, 6=Best).

The story list displays up to 150 stories per section (5 pages of 30 stories each). Each story shows:

  • Story number
  • Title (color-coded by score)
  • Source domain
  • Author
  • Score
  • Time posted
  • Comments count

The comments view shows a threaded display of comments. Features include:

  • Auto-folding of comments when first loaded for better overview
  • Collapsible comment threads
  • Adjustable font size with + and - keys or buttons
  • Author highlighting
  • Nested replies
  • Comment age display
  • HTML formatting preserved from original comments

To save a story to your favorites:

  1. Click the star icon next to a story.
  2. Access your favorites by clicking the hamburger menu (☰) in the upper left.

Favorites are stored locally in a SQLite database.

The application follows a simple architecture with three main components:

  1. UI Layer (main.rs): Contains the main application structure (HackerNewsReaderApp) and handles rendering with egui.

  2. Data Models (models.rs): Defines the core data structures:

    • HackerNewsItem: Represents a story/post
    • HackerNewsComment: Represents a comment with nested children
  3. Hacker News Client (hn_client.rs): Handles HTTP requests to fetch Hacker News content and parses HTML responses using the scraper library.

MIT License - see the LICENSE file for details.

联系我们 contact @ memedata.com