How hard is it to export all of the comments someone has written on HN? I have been thinking about converting my HN comment history into something like a blog. Each entry would show the title of the submission, link if applicable, and the comment and link to comment thread.
The Hacker News BigQuery data makes this quite easy:
select *
from `bigquery-public-data.hacker_news.full`
where `by` = 'ilaksh' and type = 'comment'
order by timestamp desc EDIT: seems this is out of date
Yes, but with the algolia API, you'll need to make way fewer requests, as you'll get up to 50 comments per API call + you also get the title and URL of the post where this comment was posted in the same call.
I wrote a simple program a while ago to just download all of https://news.ycombinator.com/threads?id=arp242, with my cookie set. Upshot of this is that it will include scores and flagged comments, which public sources won't have. It's useful to filter comments.
To be honest I don't remember what the exact status is; it should work because I have a large TOML file with all my comments. But I don't recall if there's anything "TODO" or if I just forgot to publish it. Need to put your cookie in the variable at the top. https://gist.github.com/arp242/4f88069cdc8166d21aa26daac7ffe...
Please remember that users gave a license to their content only to HN, not everyone. Using their data without their consent might come afoul of copyright laws.
So if you put a photo up on instagram I can yoink it and use it as I see fit?
I suggest reading the legal print: https://www.ycombinator.com/legal/ > By uploading any User Content you hereby grant and will grant Y Combinator and its affiliated companies a nonexclusive, worldwide, royalty free, fully paid up, transferable, sublicensable, perpetual, irrevocable license to copy, display, upload, perform, distribute, store, modify and otherwise use your User Content for any Y Combinator-related purpose in any form, medium or technology now known or later developed. It says here I grant Y combinator (and its affiliated companies; hm...) a licence, not that I grant it to some rando with a scrapper (or using an API). Anyone that's not Y combinator (and its affiliated companies; hm....) that's using my content posted here is doing so without any licence to do so from me, potentially violating my copyright rights.
Maybe you could provide that service for a small fee.
https://github.com/runvnc/hncomments
select * from `bigquery-public-data.hacker_news.full` where `by` = 'ilaksh' and type = 'comment' order by timestamp desc
EDIT: seems this is out of date
https://news.ycombinator.com/item?id=40634899
https://hn.algolia.com/api/v1/search?tags=author_ilaksh,comm...
You'll need to paginate it, as it's limited to 50 results per page, like so:
HN has API.
To be honest I don't remember what the exact status is; it should work because I have a large TOML file with all my comments. But I don't recall if there's anything "TODO" or if I just forgot to publish it.
Need to put your cookie in the variable at the top.
https://gist.github.com/arp242/4f88069cdc8166d21aa26daac7ffe...
https://news.ycombinator.com/threads?id=ilaksh
Is it just that you want to host it on your own domain?
Please remember that users gave a license to their content only to HN, not everyone. Using their data without their consent might come afoul of copyright laws.
I suggest reading the legal print: https://www.ycombinator.com/legal/
> By uploading any User Content you hereby grant and will grant Y Combinator and its affiliated companies a nonexclusive, worldwide, royalty free, fully paid up, transferable, sublicensable, perpetual, irrevocable license to copy, display, upload, perform, distribute, store, modify and otherwise use your User Content for any Y Combinator-related purpose in any form, medium or technology now known or later developed.
It says here I grant Y combinator (and its affiliated companies; hm...) a licence, not that I grant it to some rando with a scrapper (or using an API). Anyone that's not Y combinator (and its affiliated companies; hm....) that's using my content posted here is doing so without any licence to do so from me, potentially violating my copyright rights.
Continue this thread — 2 replies