
Show HN: Hacker News comments for your blog - rajasimon
https://hndisq.xyz
======
rajasimon
I'm super excited to introduce hnDisq to all. I have a blog website, and I
want very simple and no manageable way to add a commenting system to my blog.
The idea clicked why not I use Hacker News comment in my blog. Checked their
API, and here I'm launching hnDisq.

Check out [https://hndisq.xyz](https://hndisq.xyz) and feedback welcome.

~~~
ColinWright
By the way, you don't have contact details in your profile, so I thought I'd
mention here an answer to a question you asked four years ago. You asked about
doing an "ls" when you "cd", and someone gave you this:

    
    
        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.

~~~
rajasimon
Ah that's the great tip. thanks.

------
ColinWright
I can't see how this is deciding which comments/thread to load. In your
example it's loading comments from a thread completely unrelated to the blog
post. It's ... confusing.

~~~
rajasimon
I've mentioned how to setup hndisq in my blog.

<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.

~~~
ColinWright
Nope, still doesn't make sense. I can include my username, fine, not a
problem. But I've submitted multiple blog posts to HN, and many of them have
comments here. How does a blog post know how to pick up the comments from the
submission it relates to?

Specific examples:

Here's a blog post:

[https://www.solipsys.co.uk/new/BeingSlowToCriticise.html?te1...](https://www.solipsys.co.uk/new/BeingSlowToCriticise.html?te10hn)

Here's the HN discussion:

[https://news.ycombinator.com/item?id=23131350](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...](https://www.solipsys.co.uk/new/SellYourselfSellYourWork.html?te20hn)

Here's the related HN discussion:

[https://news.ycombinator.com/item?id=23250289](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.

~~~
rajasimon
Currently hndisq will load the comment posted by you only.

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...](https://www.solipsys.co.uk/new/BeingSlowToCriticise.html?te10hn))

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.

~~~
ColinWright
> _Currently hndisq will load the comment posted by you only._

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?

~~~
rajasimon
> What if the submission has tracking information in the URL, so there isn't
> an exact match?

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...](https://www.solipsys.co.uk/new/BeingSlowToCriticise.html?te10hn)
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.

~~~
ColinWright
CW> _What if the submission has tracking information in the URL, so there isn
't an exact match?_

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...](http://www.topicsinmaths.co.uk/cgi-
bin/sews.py?SuggestedReading)

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.

[0]
[https://news.ycombinator.com/newsfaq.html](https://news.ycombinator.com/newsfaq.html)

~~~
rajasimon
> if this becomes at all popular you might want some sort of verification.

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.

