3 ms·
I wonder if there is a way to easily export one's own Hacker News comments. It might be useful for you to back your comments up one day, as there can be value i
by jyunwai 3y ago
I wonder if there is a way to easily export one's own Hacker News comments. It might be useful for you to back your comments up one day, as there can be value in searching through your past writing and also having a backup (which never hurts).
- krapp 3y agoWrite 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
- Tomte 3y agohttps://github.com/dogsheep/hacker-news-to-sqlite https://github.com/dogsheep/hacker-news-to-sqlite