3 ms·
Write a script to download them using the Hacker News API.[0] First, get the user endpoint: https://hacker-news.firebaseio.com/v0/user/<username>.json https://
by krapp 3y ago
Write a script to download them using the Hacker News API.[0]
First, get the user endpoint: https://hacker-news.firebaseio.com/v0/user/<username>.json https://hacker-news.firebaseio.com/v0/user/<username>.json
(ex: https://hacker-news.firebaseio.com/v0/user/jl.json?print=pretty https://hacker-news.firebaseio.com/v0/user/jl.json?print=pre...)
then iterate the "submitted" array and make a request to each ID at the item endpoint:
https://hacker-news.firebaseio.com/v0/item/<ID>.json https://hacker-news.firebaseio.com/v0/item/<ID>.json
(ex: https://hacker-news.firebaseio.com/v0/item/8863.json?print=pretty https://hacker-news.firebaseio.com/v0/item/8863.json?print=p...)
Then save each JSON response somewhere. You won't be able to get the content of flagged and banned messages. If you do this more than once you'll also need to keep track of the last ID you downloaded, or the updates endpoint to catch edits, I think, although the readme is a bit vague about how exactly that works.
[0]https://github.com/HackerNews/API https://github.com/HackerNews/API