News for hackers. Stuff that matters.
Re:Ask HN: How to download comments of my favorite submissio... by tgragnato on Sunday September 22, 2019 @06:16AM (#21040593)
I'd start with a query like this (https://www.graphqlhub.com/playground?query=%7B%0A%20%20hn2%...).

But if you want recursion you might need to patch the schema (https://github.com/clayallsopp/graphqlhub).

Re:Ask HN: How to download comments of my favorite submissio... by pknerd on Sunday September 22, 2019 @01:48PM (#21042737)
This is amazing! Thnks
Re:Ask HN: How to download comments of my favorite submissio... by swiley on Sunday September 22, 2019 @05:40AM (#21040498)
Is there a reason curl and either awk or the combination of htmltidy and xmlstarlet wouldn’t work?
Re:Ask HN: How to download comments of my favorite submissio... by darrenwestall on Monday September 23, 2019 @01:46AM (#21046236)
File -> Save Page As

Or is that too simplistic?

Re:Ask HN: How to download comments of my favorite submissio... by algaeontoast on Sunday September 22, 2019 @03:35PM (#21043417)
I'm actually working on a project for this haha - curious if anyone has suggestions on a data-structure to archive comment threads?
Re:Ask HN: How to download comments of my favorite submissio... by jraph on Sunday September 22, 2019 @05:35PM (#21044102)
I would probably use an SQL-like database with a submissions table (id, title, url, sender, date, points), a users table (id, name) and a comments table (id, author, date, parent, submission, color, content).

If you prefer using maps, for each table (map), use id as the key and the rest of the fields as the fields for a structure used as the value for each entry (using a C struct, or a Python tuple, named tuple or dataclass, assuming these languages).

You may want to use the id field from the HN URLs. You could drop the submission field for the comments.

Edit: You also need to decide how to handle edited, deleted and flagged comments, and dupe and flagged submissions.

Re:Ask HN: How to download comments of my favorite submissio... by breakerbox on Sunday September 22, 2019 @11:44AM (#21041872)
Someone on HN made a github project called Monolith. It’s a command line thing. Go check it out and see if it will accomplish what you want

https://github.com/Y2Z/monolith

Re:Ask HN: How to download comments of my favorite submissio... by amirouche on Sunday September 22, 2019 @06:49PM (#21044484)
good project but not really what OP wants.