HN Lens is an open source Hacker News client for iOS/macOS devices.
- Browse all HN feeds.
- Link preview
- Search (stories).
- Immediate and progressive comment tree display/load.
- Collapse comment trees.
- Sign In, browse all personal upvoted/favorite stories/comments.
- Upvote/favorite stories/comments.
- Post replies.
- Submit stories.
The app consists of two main components, the SwiftUI part and the HackerNewsKit package that initially was part of the project.
HackerNewsKit was extracted after the line between strictly UI code and HN API wrappers and other services became clearer, it is responsible for most of the heavy lifting:
- Accessing the public HN API and the private API, basically, the functionality that's exposed through the website but not through the public API.
- Provides a search service based on HN Algolia
- Provides a convenient way to generate site preview images for URLs and parses the comments into
NSAttributedStrings
The HackerNewsKit dependency uses Firebase to access the public HN API, therefore the project requires a GoogleService-Info.plist
config file in the HN Lens
folder.
See how to generate and download the Firebase config file for details
The most important step is to add the database URL in plist:
...
<key>DATABASE_URL</key>
<string>https://hacker-news.firebaseio.com</string>
...
HN Lens is free software available under Version 3 of the GNU General Public License. See COPYING for details.