HN comments with links to HN
news.ycombinator.comTo show comments containing links to foo.com, visit /from?site=foo.com&kind=comment.
For example, to see all comments containing links to x.com:
https://news.ycombinator.com/from?site=x.com&kind=comment
Or all GitHub links:
https://news.ycombinator.com/from?site=github.com&kind=comme...
Remarkably it matches subdomains too. Here’s all gists posted to HN:
https://news.ycombinator.com/from?site=gist.github.com&kind=...
The submitted url shows all HN links posted to HN (i.e. comments containing news.ycombinator.com):
https://news.ycombinator.com/from?site=news.ycombinator.com&...
Note that this is distinct from showing comments with links to ycombinator.com, which doesn’t show links to HN:
https://news.ycombinator.com/from?site=ycombinator.com&kind=...
I find this impressive, since it’s not merely matching text (otherwise site=ycombinator.com would also show HN links).
You can even set site=github.com/antirez to find comments with links to antirez’s repos:
https://news.ycombinator.com/from?site=github.com/antirez&ki...
site=x.com/paulg doesn’t work though, so apparently site=domain.com/path only works for certain domains.
I just discovered this, and embarrassingly emailed Dan asking whether kind=comment was broken since I didn’t understand what I was looking at. Was this announced somewhere and I missed it?
A bit off topic, but: Is there a way to get my comments, sorted by most popular? news.ycombinator.com/threads:id=AnimalMuppet... and then what?
Or do I want something other than "threads" there, since I could accept just my comments, rather than the whole comment thread.
Unfortunately no, not to my knowledge. Only your account can see how many points your comment has, so the only way to build this would be to scrape your comments (10 at a time) from /threads?id=AnimalMuppet and then sort them by points yourself. Which is impractical, sadly.
But why impractical? That's just a wget loop, right? Or is it the sort part that you think is impractical? That's just a matter of writing a perl (or whatever) script to pull out the IDs plus upvotes, sort by upvotes, and grab the IDs. Then you can use grep or whatever to find which files those IDs wound up in and extract the comments.
I mean, that's more work than I'm going to do for a vanity project, but I could...
You’re right. HN asks for a crawl delay of 30 seconds. So if you want to be a good citizen and you have a thousand comments, that’d take about 8 hours. Not too bad.
You can do it by including your “user” cookie. (You can get that by examining the cookie store via the browser.)