3 ms·
I wrote some code for my site that 1) finds the most active link to the post on HN, and 2) uses the HN API to pull in and render its comments at the bottom. The
by brundolf 5y ago
I wrote some code for my site that 1) finds the most active link to the post on HN, and 2) uses the HN API to pull in and render its comments at the bottom. The site is statically-rendered, but there's a bit of client-side JS that loads the latest comments when you visit the page. Most of the work is done on the back-end; the front-end just grabs the content and drops it in.
Example: https://www.brandons.me/blog/three-types-of-data https://www.brandons.me/blog/three-types-of-data
Implementation: https://github.com/brundonsmith/website/blob/master/src/loadHnComments.js https://github.com/brundonsmith/website/blob/master/src/load...