
ShowHN: AlreadyHN, a bookmarklet that checks if the current page is on HN - eliaskg
http://elias.kg/post/15568386753/alreadyhn
======
Pewpewarrows
If you're using Chrome, this extension works great to let you know about pages
being on HN:

[https://chrome.google.com/webstore/detail/njdndkhkelkeepcnmo...](https://chrome.google.com/webstore/detail/njdndkhkelkeepcnmookckfhleebcokl)

~~~
dionidium
I'm pleased to see that this extension sends only the hashed URL to its
server, so you're not giving away your full browsing history in real time:

    
    
        var url_hash = hex_md5(tab.url);
        xhr.open("GET", "http://hnd.mfairley.com/" + url_hash, true);
    

[https://github.com/michaelfairley/hnd-
client/blob/master/bac...](https://github.com/michaelfairley/hnd-
client/blob/master/background.html)

~~~
JangoSteve
Awesome for security. In order for this to work, the server-side has to keep a
record of every single URL posted to HN, to be able to do a lookup of the
hash. It's crawling the "/newest" page [1] once a minute [2]. Not sure how he
handles situations where the worker goes down (do those posts just not get
indexed?).

[1] [https://github.com/michaelfairley/hnd-
server/blob/master/upd...](https://github.com/michaelfairley/hnd-
server/blob/master/update.rb)

[2] [https://github.com/michaelfairley/hnd-
server/blob/master/app...](https://github.com/michaelfairley/hnd-
server/blob/master/app.rb#L14)

------
chetan51
A while ago, I posted a bookmarklet called Hacker Panel that actually shows HN
comments for the current page. Do check that out too!

<http://news.ycombinator.com/item?id=2915367>

~~~
iambot
That sounds really good. Will definitely check it out

Shameless plug: is is my last bookmarklet for HN:
<http://christopherdebeer.github.com/hnCommentWatcher/>

Update: I was a bit let down that you just show the HN page in an iframe, nd
dont actually restyle the comments in a user friendly way like in a side bar
for the site (which i think would be brilliant)

~~~
chetan51
The thing is, I wanted to give the user complete HN commenting functionality,
and have the comments look like regular HN comments too. So I figured that
sourcing the actual comments page would be the best, since you get to use it
just like you would if you visited HN directly.

------
nsxwolf
I wonder how I earn a living doing what I do, and have never heard the word
"bookmarklet". Reading the definition I know what they are, I've just never
heard the term until now.

One nice thing about HN is that I can admit to such things because of the
anonymity. It sure is an embarrassing feeling.

~~~
akkartik
I saw the XML icons on websites for years before paying attention to what they
meant (RSS feed) and what you could do with it (feedreaders, etc.)

We as a profession suck. It's not a criticism, just a statement of fact. We're
in the stone ages. The interfaces my fellow programmers create are hard to
discover, hard to understand, hard to use. And then I try to create interfaces
and end up perpetrating the same crimes in my turn.

------
Todd
Nice. I'm often conflicted over whether to bookmark the actual page or the HN
comments. Sometimes the comments are so valuable, I'll bookmark them instead,
since I can always get to the page in question from the comments. This
provides a nice alternative. Thanks.

~~~
jay_l
I always just bookmark the comments, or a link to a particularly valuable
comment, instead of the actual page for the same reasons.

I have a separate folder for the actual pages that I link with their
corresponding HN bookmarks using Firefox's tagging feature. It makes it easy
to find and load up both pages.

------
LocalPCGuy
Added a fork, use it if you like, that checks to see if you are already on the
Hacker News site, and if so, redirects you to the first page. Not sure why you
would be checking it on Hacker News, but seemed like it should know that and
response accordingly. Feel free to ignore or close the request if deemed
useless.

------
jamesbritt
"Simply drag the following link to your browser’s bookmarks bar:"

I can't. I'm on FF 8.0, and the link doesn't seem to be a normal link, so
dragging it ends up as a selection.

Indeed, it's not a normal link:

    
    
        <a id="theLink" title="AlreadyHN">AlreadyHN</a>

~~~
Garbage
Right click on the link and select "Bookmark This Link"

~~~
jamesbritt
Thanks, but that option doesn't appear. I can do that in Chrome, which gives
me a URL for the a element, so I'm guessing the link is dynamically created
(for whatever reason) and that's not playing nice on my install of Firefox.

------
Ryan_Shmotkin
I use a chrome extension. Shows you a orange bar on the left that slides out
with comments.

[https://chrome.google.com/webstore/detail/hhedbplnihmkekhgma...](https://chrome.google.com/webstore/detail/hhedbplnihmkekhgmaoikgfbkjjaocnl)

~~~
Flenser
and sends your full browsing history in real time to thriftdb.com!

The extension in the first comment does not.

------
ImJasonH
Why does this load JQuery for nothing but a simple JSONP request?

------
username3
Removed confirmations, added page title. <http://pastebin.com/ySr5PnKu>

------
drats
Is there a public database of HN links (rather than multiple people crawling
PG's server)?

------
vaksel
doesn't HN do that already? or is that only for exact match links?

~~~
eliaskg
It is only for exact matching links.

~~~
p4bl0
So HN already does this and it does it exactly the right way: if you submit
something which already exists, it upvotes it instead of resubmitting it,
which is exactly what you want.

If you want to submit a link (or upvote it) anyway, what is the added value of
this bookmarklet?

~~~
joshmanders
Who wants to copy and paste a link into the submit page on hacker news, then
get the message that it already exists when they can click this little
bookmarklet.

I like it, good job!

~~~
duck
Or just use the bookmarklet from the submit page...

~~~
joshmanders
Yeah, that works too, but this bookmarklet adds onto that by not only
submitting it, but also takes you to the comments in case it already exists.

It's like saying "why use powered windows, when hand cranks work just fine"

------
deutronium
Wow, thats really nifty, thanks for making it!

------
jaequery
any idea why gethoneybadger.com doesn't get detected with this when it was
posted on HN just a week back?

------
fady
whoa! great bookmarklet. very useful indeed. how long did this take you to
make?

~~~
eliaskg
Thanks! Since this is only a fun project the script took about 2 evenings of
(casual) coding.

