Show HN: Hacker News comments for your blog
hndisq.xyz
hndisq.xyz
Check out https://hndisq.xyz and feedback welcome.
cd_(){
cd $*
ls
}
alias cd=cd_
That kills you if the directory has thousands of files, and especially if you're working over a slow connection. You can modify it like this: cd_(){
cd $*
ls | head -n100 | column
}
alias cd=cd_
That then only lists up to 100 files. You can further extend it to put "..." if there are more files, but I'll leave that for another time.<div id="hndisq" data-username="hndisq></div>
You have to replace username with your username like this. And place this in your blog website.
<div id="hndisq" data-username="ColinWright></div>
Once that done it will automatically fetch all of your hacker news submission. For example if you have a blog ColinWright.com and you created a new blog ColinWright.com/blog/my-new-blog.
And also you submitted the blog to Hacker News then the hacker news comment will automatically load.
I'm not good with explaining. Hope you understand the above context.
Specific examples:
Here's a blog post:
https://www.solipsys.co.uk/new/BeingSlowToCriticise.html?te1...
Here's the HN discussion:
https://news.ycombinator.com/item?id=23131350
How would that blog post know to pick up that discussion?
Here's another blog post:
https://www.solipsys.co.uk/new/SellYourselfSellYourWork.html...
Here's the related HN discussion:
https://news.ycombinator.com/item?id=23250289
How would that blog post know to pick up that discussion?
I think it's potentially a great idea, but I don't see how to use it. You've described that I put in my HN username, and in the example you give I can't see why it's picking up the discussion about netflix. You didn't submit that, and you don't seem to name it anywhere.
I don't know what you're actually doing, because what you say doesn't match what I see.
Sorry, this might not be clear, but you've got me terribly confused about what it actually does.
So let me ask some specific questions:
That netflix discussion wasn't submitted by you, and doesn't seem to be related to your HN username. Why is that discussion being loaded in the blog post?
If I submit a blog post to HN, what do I put in the blog post to include comments from that specific HN submission?
I hope that's clear ... thanks.
When your blog post page loads it will send two things to hndisq.
One is the username ( ColinWright ) Another one is href of the current blog page. (https://www.solipsys.co.uk/new/BeingSlowToCriticise.html?te1...)
So I know your username now and I can get all the submission from HN based on your username. And I will use the href to identify the correct submission. Once it found the submission it will use the submission id to load the comment.
Well that doesn't seem to be the case, because on your blog post it's loading this discussion, including comments by us both.
> When your blog post page loads it will send two things to hndisq.
OK, so there is more going on than just the given parameters. You never mentioned that.
> One is the username (ColinWright) Another one is href of the current blog page. (https ... /BeingSlowToCriticise.html?te1...)
OK, so on page X you include the snippet. That snippet includes ones username. But when the snippet executes it sends that username and the referring page. OK.
> So I know your username now and I can get all the submission from HN based on your username.
Yes.
> And I will use the href to identify the correct submission.
What if the page has been submitted more than once?
> Once it found the submission it will use the submission id to load the comment.
Right.
So the questions that remain are:
* What if the submission has tracking information in the URL, so there isn't an exact match?
* What if there's more than one submission?
The program will look the path and it will not consider the query params for the identification.
i.e) https://www.solipsys.co.uk/new/BeingSlowToCriticise.html?te1... Here new/BeingSlowToCriticise.html this will never change right. So it uses the path to identifies the submission.
> What if there's more than one submission?
Isn't that submitting the link more than once against the policy? Right now if that's the case then it will use the old one but I will write the program to take the last submitted one.
RS> The program will look the path and it will not consider the query params for the identification.
Sometimes the "query params" are actually specifying the page to be fetched, so sometimes they are an essential part of the URL. To the best of my knowledge, this is an unsolved problem, and I was wondering how you dealt with it.
RS> i.e) ...
I think you mean "e.g." ... "i.e." means "that is" and is used as a re-write, re-wording, or re-statement of what's already there. In contrast, "e.g." means "for example". You were giving an example, so I think you should use "e.g.".
RS> ... Here new/BeingSlowToCriticise.html this will never change right. So it uses the path to identify the submission.
That's true in this case, but not true in every case. For example:
http://www.topicsinmaths.co.uk/cgi-bin/sews.py?SuggestedRead...
Here the part after the "?" is specifying the page you want, and so it's an essential part of the "pointer to content".
CW> What if there's more than one submission?
RS> Isn't that submitting the link more than once against the policy?
From the FAQ[0]:
=====================
FAQ> Are reposts ok?
FAQ> When a story has had significant attention in the last year or so, we bury reposts as duplicates. If not, a small number of reposts is ok.
=====================
RS> Right now if that's the case then it will use the old one but I will write the program to take the last submitted one.
This is also an unsolved problem. If there is a successful re-submission one can assume that the previous submission got little to no traffic, so taking the most recent might be better.
Finally, if this becomes at all popular you might want some sort of verification. A method that's been used in the past is to have someone put a user-specific token in their HN profile. But that's some way off yet, getting traction is the hardest problem of all.
Hope this helps.
Thanks, I also want this to take off.
I was planning to create a system that takes some sort of token on HN user profile for authentication purpose. But that's too complicated and I don't want my user to update anything on the HN profile about section.
I also experimented with add submission id on the hndisq div element like this.
i.e) <div id="hndisq" data-submission_id="23281767"></div>
but this is not easy for frequent blogger. May be I will add this feature later so that in some page you can add hndisq comment.
> Here the part after the "?" is specifying the page you want, and so it's an essential part of the "pointer to content".
Mm I never thought this. Thanks for the information. I will revisit this area later.
Now that I've posted the hndisq to HN now it will load this discussion on the homepage.
So you need to change the "Demo" section to say something like:
> "Initially as a demonstration we were force-loading comments from a different discussion, but now we can use the real comments for this post."