HN-comments-drawer: one line HN comments integration into sites
github.com
github.com
https://news.ycombinator.com/item?id=12898366
In the end I was contacted by HN and was told to shut it down, and so I did since I didn't want to get into a fight. Wonder if you'll receive a similar message or they'll allow it now. There were 3 very important points that I don't see in your project:
1. I moved from "story ID" to "story URL" in the end, since a single URL can have multiple HN threads and I'd be interested in them.
2. The time of comment is _very_ important, not sure why you are not showing it?
3. I had to add some mechanism to block individual comments, while rare there _is_ SPAM and ad-hominem in HN and if you are showing the comments in your project, you might want to do a bit of comment moderation. How much, then it's to the person sharing it, with Comments Network you could also show a single individual comment
IMO: If Hacker News doesn't want this kind of thing, it should be explicitly called out in the TOS. Otherwise, they don't have much of a leg to stand on. (Except by blocking these kinds of things server-side.)
HN is bigger than a blog, but it's still small enough that it can be fully moderated with 1-2 people, and I think similar tradeoffs apply here.
you wouldn’t download a car.
PS, Hacker News might not even be in the position to officially allow this, similarly to how a generic OSS dev cannot just relicense a project without getting consent from all contributors (or a previous CLA).
there are a few alternate frontends to hackernews. technically this would be no different.
likewise linking to hackernews discussions should also be ok.
maybe an issue with load on the site if this becomes to popular?
It actively ruins the experience here by allowing content that doesn’t originate from this website.
A changed UI and making the site a “feature” of another site are not the same thing.
id="hn-comments-drawer storyId-38300167 maxDepth-3"
Please use data-attributes or another more suitable alternative than id for settings.
https://developer.mozilla.org/en-US/docs/Learn/HTML/Howto/Us...
I shared last week a commenting system that accepts comment submissions via email https://r3ply.com
Note that it's a share button that also works as a link to the latest comments section, so you get the best of all worlds IMO
[1] https://taylor.town/hn-discuss
<a id="hn-discuss" href="https://news.ycombinator.com/submitlink">
Discuss this page on HackerNews.
</a>
const hn = document.getElementById('hn-discuss');
// Set href to "share current URL and title".
hn.setAttribute(
'href',
`https://news.ycombinator.com/submitlink`
+ `?u=${encodeURIComponent(window.location.href)}`
+ `&t=${encodeURIComponent(document.title)}`
);
setTimeout(
() => {
// Replace href with most popular HN link from the past 4 months.
fetch(
`https://hn.algolia.com/api/v1/search`
+ `?tags=story`
+ `&restrictSearchableAttributes=url`
+ `&numericFilters=created_at_i>`
+ Math.round(new Date().getTime()/1000 - 4*30*86400)
+ `&query=${encodeURIComponent(window.location.href)}`
)
.then(res => res.json())
.then(data => {
const id = data?.hits?.[0]?.objectID;
if (id)
hn.setAttribute(
'href',
`https://news.ycombinator.com/item?id=${id}`
);
})
.catch(err => console.error(err));
},
// Wait 10 seconds before hitting Algolia!
10*1000
);> Live demo: https://hn-comments-drawer.vercel.app/examples
> Code: https://github.com/giesf/hn-comments-drawer/
Dramatic. Not OP but thanks for doing this.
I wondered about something like this before, and wasn't sure HN would be happy being a comment provider.
Sure, many blog posts end up with a good discussion on HN, but it's not a given that any blog post deserves a HN posting. Especially with self-promotion (not marked as such) being frowned upon.
Likely it isn’t.
I had considered offering something similar for https://kulli.sh which also aggregates comments on posts from a whole bunch of other sources too, but after reaching out to a number of people whose shared posts actually get comments here on HN and other places, I quickly realized there is not much desire for something like this from people whose writing is actually discussed.
(I'm a big fan of pulling comments back to the original post, as long as you can do it without causing trouble for the discussion site!)
looks quite sweet!