top | item 27900862

Show HN: I developed a native macOS Hacker News client

188 points| goranmoomin | 4 years ago |github.com | reply

81 comments

order
[+] goranmoomin|4 years ago|reply
Hello, I’m the developer. Didn’t expect a Show HN post to go into a second—chance pool — I woke up an hour ago to find that my app was trending on HN.

I developed this b.c. I found that I didn’t like HN mixed with other work/school related tabs, and realized that a separate app would be great for me. I believe that apps should use the most native-like UI possible — especially Cocoa on macOS, so I aimed to be the most ‘Mac-assed’ HN client possible.

Unfortunately the current app is in fact pretty unpolished — it’s in a usable state, but there’s a lot of missing features that one would expect from a ‘full-featured’ HN client. Probably a bunch of unknown bugs as well :-(. I would very appreciate any suggestions on feature additions or simple bug reports. Thanks!

[+] jbc1|4 years ago|reply
Look forward to trying it out, thanks!

If you find yourself in a position of not wanting a specific website mixed in with your browser tabs again but not caring enough to make another native app, check out nativefier. Quickly makes an electron wrapper for any website.

https://github.com/nativefier/nativefier

[+] brailsafe|4 years ago|reply
Thanks for putting it together. I've been curious about modern macos development for a while, but haven't found many good resources on what that entails. In the past, I used BigNerdRanch's Cocoa book to put together a small UI that accessed an external service in ObjC, but that book hasn't received updates in a hell of a long time.
[+] soheil|4 years ago|reply
Are you planning to charge for this in the future? Seems to be getting really high traction.
[+] Naac|4 years ago|reply
Does the Algolia hackernews api ( the specific API this client uses ) still require you to query in a tree like fashion, every comment item id if you want an entire page of comments?

Its extremely inefficient, to the point where I have a better time curling the HN web page and piping it through python beautifulsoup

Regarding a native app vs the using the HN website. The HN website I think is pretty ideal for the type of content its displaying, a native app doesn't give you much over having a HN tab open. I guess only if you want to read HN but not have a web browser open? But how often does that happen?

The only benefit I see from a native app ( and why I use one on Android ) is the ability to save articles and comments for offline reading, say, when I get on a plane.

[+] pcr910303|4 years ago|reply
> Does the Algolia hackernews api ( the specific API this client uses ) still require you to query in a tree like fashion, every comment item id if you want an entire page of comments?

I’m using two different APIs — the inefficient API that requires you querying in a tree fashion is the HN official API[0], but there’s also the Algolia API[1], which is much faster and gives a much sensible data shape. I also do actually fetch the HN website as well — it’s needed for account/voting features. With these sources, it’s much faster than a usual client that gets it’s data from the official API.

> The HN website I think is pretty ideal for the type of content its displaying, a native app doesn't give you much over having a HN tab open.

I guess it’s a bit of difference on how one uses HN? I didn’t like HN tabs being mixed with other work—related tabs. I felt that having an app would be a perfect solution to me, but YMMV I guess.

> The only benefit I see from a native app is the ability to save articles and comments for offline reading

I guess that’s one more feature that I should add to my backlog :)

[0]: https://github.com/HackerNews/API

[1]: https://hn.algolia.com/api

[+] dahfizz|4 years ago|reply
Agreed. Generally I prefer native apps, but HN is so well designed and so minimalist that I don't feel it needs a native client.
[+] Karrot_Kream|4 years ago|reply
> Does the Algolia hackernews api ( the specific API this client uses ) still require you to query in a tree like fashion, every comment item id if you want an entire page of comments?

> Its extremely inefficient, to the point where I have a better time curling the HN web page and piping it through python beautifulsoup

Yes it still does and yeah it's ridiculously inefficient. I have a couple tools I've written atop the HN API and all of them are forced to go async simply because the sheer # of page loads necessary to render a thread makes async almost a necessity.

[+] geoah|4 years ago|reply
Thanks for sharing this. It looks really great and pretty minimal which I personally love. The main thing I'm missing from this would be read/unread indicators on stories.

A roadmap of planned features would be nice or some tickets that other people could help with.

I'm not sure how much time you plan on spending this, but I'd personally probably be willing to buy a version of this if it was able to do notifications on replies and similar features hn lurkers might want. Other interesting paid features could be read-later list, favourites, cross device syncing of read indicators and lists, etc. If you don't wanna deal with paid features maybe consider enabling the github sponsor feature so people could optionally pitch-in.

[+] pcr910303|4 years ago|reply
For me, right now, this is a hobby project — until now, the feature roadmap was basically the feature that I have in mind.

I’m more than happy to get feature requests though — read/unread indication and favorites are something that I would definitely try implementing. Notifications are a bit harder because it would require polling HN — I’ll be thinking on it.

[+] harisamin|4 years ago|reply
This is great! I built a native. macOS client that I actually sold in the AppStore a while ago. It did everything was native except rendering of the article but I was just using plain web view for that part. The pain was keeping but synced with changes on HN. I still have a personal build that I use on a daily basis.

I still have the landing page up which warning, looks awful on mobile https://mackernews.com/

But congrats! I stopped selling my client and it’s starting to show age for my personal use too. Will check this out. Do you have voting and commenting working? That’s one thing I miss the most that stopped working on my client.

[+] leecb|4 years ago|reply
Very happy to see a "mac-assed" app!

My only complaint so far is that I can only see about 12 items in the app on one screen, vs the whole front page in a browser. Adds a lot more scrolling.

[+] pcr910303|4 years ago|reply
I guess I’ll have to add a compact mode that hides some of the UI. Thanks for the idea!
[+] SavantIdiot|4 years ago|reply
This raises a question I've always wondered:

How many of you prefer to run a native app rather than the web app?

Personally I hate installing things on my desktop if there is a website because it is just another thing I have to manage. (Even more so because I have multiple Windows, Mac and Linux boxes I'm bouncing around between during the day and rather just have sync'd Firefox bookmarks than have to install s/w on each box.)

Am I in the minority, majority, both, neither?

[+] kitsunesoba|4 years ago|reply
I like native apps (as in, uses the host platform’s UI toolkit) where available, because it’s almost a given that the operating systems’s typography, color scheme, etc are more legible and less annoying than whatever choices were made by a website’s designer. This is especially important now that all major desktop OSes implement a dark mode, which many sites still lack.

Things like reader mode and user styles help a lot with that, but they’re both kind of clunky bolt-ons and in the case of userstyles, often manual since many sites don’t have any readily available.

A lot of this could be improved if browsers had restyling built in as a first class feature and site owners were incentivized to make their sites work with it.

[+] seany|4 years ago|reply
I don't think I've ever picked the web interface over native as long as the native app is "really native"
[+] tasogare|4 years ago|reply
Of course desktop software, as they are way better than web sites.

- don't need to create yet another account (and won't be deplatformed arbitrarily)

- my data stay in local and are not used in shaddy way by the service provider

- usable offline or with poor connection

- better performance

- I'm in control with upgrades

Webapps in general are hostile to the user and are just a way for the developer to take over (undue) control over the software usage and user data.

[+] judge2020|4 years ago|reply
I prefer PWAs since it combines the window-ness of regular applications with the security sandbox traits of websites in the browser.
[+] dheera|4 years ago|reply
Prefer web, less chance of spyware/malware, easier to inject custom CSS, easier to inject custom JS to disable features/spying/telemetry you don't want.

I use Slack's web client for this reason, I don't want it to tell the other person when I'm typing.

[+] willyt|4 years ago|reply
Depends. Something I use all the time, like a music player or a chat app, I hate having to use a web app or a app that just wraps a web interface as they are usually slow, clunky, glitchy, power hungry and with non-standard interfaces especially things like keyboard shortcuts, drag n drop support. But something like this app I would probably never install as I don’t spend that much time writing stuff on HN. HN is just a website that links to other websites that I mostly just have a look once or twice a day for semi-obscure interesting science, tech and design news that hasn’t made it to ars technica or whatever.
[+] TranquilMarmot|4 years ago|reply
I'm the same way; I use multiple machines (and my phone!) every day so having synced Firefox tabs is ideal. Especially for something as simple as Hacker News a native client seems a little... overkill?
[+] justaguy88|4 years ago|reply
I always prefer the native (so long as it's really native, not just electron)

I'm usually lost in a sea of browser tabs

[+] gwbas1c|4 years ago|reply
Usually native

I like my apps to have an icon in the dock/taskbar, and I like being able to alt/command - tab. For web apps that I use a lot, I make an app shortcut so the app has it's own window and dock/taskbar icon.

The thing is, I really need tabs/multiple windows for some apps. (Log viewers, Jira/Asana, GitHub...) I used to use application-specific browsers for those sites, but the html engines never kept up.

I usually like electron apps... When they're correctly made. Slack's electron app works well. LastPass's electron app is missing too many features and doesn't integrate into the browser.

[+] chris37879|4 years ago|reply
There's some things I prefer native apps for, others I prefer web for. But it's a highly personal choice, I think. For instance, for me, all web and social stuff is browser based, but I _loathe_ using chat or email in a browser. And until quite recently, I still used a desktop RSS reader just for headline aggregation, I finally gave up on that as another handful of sites I follow killed their RSS feeds.
[+] soheil|4 years ago|reply
I really don't like the idea of a native app unless it's a 10x improvement. Beyond privacy concerns at install time there is also the fact that it could be phoning home and log your activity or even send your session cookie who knows where. Even if the code is open source and it can be trusted today what if tomorrow it autoupdates after a hacker seizes control of the repo?
[+] et-al|4 years ago|reply
On a phone, I can see apps being easier to use (saved credentials and ideally the UX is streamlined for touchscreen use). But if I have a keyboard and mouse, I strongly prefer a web app for stuff that requires minimal interaction from me because it's sandboxed and accessible anywhere.

A native app should be snappier and maybe offline capable, but I'm not expecting to use Hacker News offline.

[+] brailsafe|4 years ago|reply
I much prefer a native mac experience for things that aren't necessarily tied directly to services and I do more than just read on, and usually that I'd like them to be offline by default. However, I've been wanting a HN client for a while for some reason. I don't sync tabs around, but do use Firefox.
[+] jll29|4 years ago|reply
In the absence of a USENET news server comp.bbs.hn, a TUI RSS reader would be the next best thing for me, and viewing the site in a Web browser after that.

(I appreciate that many will enjoy a native app, and I applaud the effort, but for me personally content sites are harder to keep track of if each has its own app.)

[+] blondin|4 years ago|reply
prefer native.

my number one reason is that most native apps care about accessibility (and my other preferences, fonts, UI, etc.)

the idea that modern web-based apps (mobile or desktop) provide a modicum of accessibility is laughable at best. it is something that makes me depressed everyday.

[+] npunt|4 years ago|reply
Looks good but needs text zoom (cmd =/+ and cmd -).

I'd also consider the sidebar include 'My Posts' and 'My Comments'. Maybe it has those, but I couldn't tell, as I turned off outgoing network access to firebase before logging in just to be on the safe side. Any reason you're connecting to firebase rather than storing preferences locally? I'm worried about my HN credentials being stolen.

[+] pcr910303|4 years ago|reply
Thanks for the feature requests! Will definitely add a text zoom feature and a ‘My Posts’ category.

> Any reason you're connecting to firebase rather than storing preferences locally?

All of your preferences are stored locally — the firebase connection is due to the official HN API[0] implemented on Firebase. Your HN credentials never leave the app (except for news.ycombinator.com) — it’s tucked in your keychain.

[0]: https://github.com/HackerNews/API

[+] soheil|4 years ago|reply
Here is some code for a simple chrome ext for HN to show votes/created date/bio inline (just stick it in a chrome ext)

  function hackernews() {
    if (document.location.toString().indexOf('news.ycombinator') === -1) return;
    document.querySelector('#hnmain td').style = 'background-color: #55b6f2;';
    var i = 0;
    function render(user, html) {
      const div = document.createElement('div');
      let style = 'cursor: text;overflow-y: scroll; height: 39px;position: absolute;border: 1px dotted #828282;width: 250px;margin-left: 250px;margin-top: -34px;background-color: #f6f6ef;';
      div.innerHTML = html;
      const date = div.querySelectorAll('tr')[5].querySelectorAll('td')[1].innerHTML.split(', ')[1];
      const karma = div.querySelectorAll('tr')[6].querySelectorAll('td')[1].innerHTML;
      const about = div.querySelectorAll('tr')[7].querySelectorAll('td')[1].innerHTML;
      if (about.length < 60) {
        style += 'display: flex;flex-direction: column-reverse;margin-top: -39px;border: none;background-color: transparent;';
      }
      div.innerHTML = about;
      div.style = style;
      user.querySelector('.age').innerHTML += date ? ' ' + date + ' ' + parseInt(karma).toLocaleString() : ' (x_x)';
      user.appendChild(div);
    }
    function next() {
      if (i >= document.querySelectorAll('.default .comhead').length) return;
      const user = document.querySelectorAll('.default .comhead')[i++];
      if (!user) return next();
      const username = user.querySelector('a').href;
      if (username.indexOf('soheil') !== -1) return next();
      
      const html = localStorage.getItem(username);
      if (html) {
        render(user, html);
        next();
        return;
      }
      fetch(username)
      .then(res => res.text())
      .then(res => {
        localStorage.setItem(username, res);
        render(user, res);
        setTimeout(next, 3000);
      });
    }
    next();
  }
[+] c17r|4 years ago|reply
On my "projects to do when I have lots more free time" list is to make a Hacker News NNTP server. Read only, of course. Few details to work out (edits, polls, making comments, etc) but I think it could work. It would solve the "what's new in this thread" problem.
[+] jll29|4 years ago|reply
Would be great to get that and read it in Emacs (gnus).
[+] Jerry2|4 years ago|reply
Excellent work! I really like the UI. I've been using some iOS app for HN because the UI offers easy and quick swipe-based upvotes and bookmarking. But your UI is more reminiscent of a mail app and that's better suited for a desktop app. So kudos!
[+] tyingq|4 years ago|reply
Looks nice. More screenshots would be appreciated...for example, how it displays italics, indented text "code blocks", the limited amount of emoji/utf-8 supported on HN, etc.
[+] paulcole|4 years ago|reply
God I would love somebody to make one of these that could block specific users, linked sites, or topics/keywords.
[+] soheil|4 years ago|reply
It's open source, send a PR?
[+] przemub|4 years ago|reply
I like that you kept at it for 1.5 year - it is inspiring me to pick up some projects I've half-started.
[+] tailspin2019|4 years ago|reply
Haven’t tried it yet but the screen shot looks great. Clean, simple and not over engineered.
[+] caseyf7|4 years ago|reply
Would love to see the ability to search and/or export upvoted submissions/comments.
[+] grishka|4 years ago|reply
Any chance for Mojave support? It currently requires Big Sur. Looks good on screenshots tho.
[+] pcr910303|4 years ago|reply
Unfortunately I’m not expecting to support anything lower than Big Sur. I tried supporting Catalina, and having to support an OS that I don’t use daily was hard… Sorry about that. :-(
[+] culopatin|4 years ago|reply
I’d love to see the HN crowd make this app amazing through PRs
[+] sys_64738|4 years ago|reply
Wouldn’t Vienna with the RSS feed give you the same?
[+] zapzupnz|4 years ago|reply
I love seeing more Mac-assed apps.