Hacker News in Anvil (ui mod)

Hi,

I’m a (very…) regular visitor of Hacker News (https://news.ycombinator.com) but the UI had some annoyances for me (hard to click on comments, especially on mobile and not clear how to collapse comments) , so why not ‘scratch my itch’ and build it in Anvil ? :grinning:

Since they make an API available (GitHub - HackerNews/API: Documentation and Samples for the Official HN API) which you can call over HTTP this was also a nice learning opportunity for me to use the anvil_extras non_blocking functionality to call the API asynchronous.

It was (again) a very pleasant experience how easy it is to build this in Anvil in less then 100 lines of code. I’m especially pleased with the nested datagrids and the way comments are added while you read
You can see the result at https://hackernews.anvil.app/

If you want to see how this is done, make your own version or have suggestions how to do it better, here is a clone link:

https://anvil.works/build#clone:N3EMRR7OV23STQIB=6GMHFW53CYNV6E3XPG3FYKZK

p.s. You apparantly can also use Firebase for the integration but after a quick look at some of the docs i couldn’t really understand how that is supposed to work.

9 Likes

One thing - the icons you click to open the comments are not displaying properly :

hmm they are not icons but unicode text… maybe dependant on browser settings/code pages installed? maybe i’ll switch to icons but had problems with alignment

1 Like

Works fine on edge windows 10

changed to icons now, so https://hackernews.anvil.app/ is updated

1 Like

How did you do those nested carrot drop-down menus? I was trying to do something similar.

I like it. Didn’t see the point at first, but it is much easier on the eye.

One thing - there’s no usernames for the posters. Though I’m undecided if it’s better for that or not …

I provided a clone link so you can look at the code to see how it is implemented.

I know, just put in the most basic stuff.

Yes, I’m still going through it. Thanks, still trying to figure it out.