TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Async, embeddable HN share button

63 pointsby igrigorikabout 13 years ago

10 comments

huhtenbergabout 13 years ago
There's nothing more sad and somewhat pathetic than a "share on... " button with a single digit counter. Perhaps hide the counter if it's under configurable threshold?
评论 #3844903 未加载
igrigorikabout 13 years ago
Working on auto-instrumenting the button with Google Analytics trackSocial stuff - stay tuned.
评论 #3844988 未加载
stbullardabout 13 years ago
cf. last year's discussion of <a href="http://hnlike.com" rel="nofollow">http://hnlike.com</a>: <a href="http://news.ycombinator.com/item?id=2934178" rel="nofollow">http://news.ycombinator.com/item?id=2934178</a>
nilvedabout 13 years ago
For something unrelated, what's the point of code like this?<p><pre><code> &#60;script&#62; (function() { var hn = document.createElement('script'); hn.type = 'text/javascript'; hn.async = true; hn.src = 'http://hnbutton.appspot.com/static/hn.js'; var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(hn, s); })(); &#60;/script&#62; </code></pre> Why not just put in the generated script tag? Moreover, why does it matter where the tag is placed if it's loaded with async as opposed to defer?
评论 #3845065 未加载
DanielRibeiroabout 13 years ago
Great! It would be awesome if it can be made to work with Wordpress (the vanilla hosted site). Or maybe I should just start blogging like a hacker[1, 2]...<p>[1] <a href="http://tom.preston-werner.com/2008/11/17/blogging-like-a-hacker.html" rel="nofollow">http://tom.preston-werner.com/2008/11/17/blogging-like-a-hac...</a><p>[2] <a href="http://www.allthingsdistributed.com/2011/08/Jekyll-amazon-s3.html" rel="nofollow">http://www.allthingsdistributed.com/2011/08/Jekyll-amazon-s3...</a>
nodesocketabout 13 years ago
Great work, but are you serving `hn.js` from a CDN like CloudFront, so in the event that your website goes down, it doesn't effect others. Also, the url the iframe calls: <a href="http://hnbutton.appspot.com/button?title=some-title&#38;url=some-url" rel="nofollow">http://hnbutton.appspot.com/button?title=some-title&#38;url=...</a>, how can we be sure that is always going to be available?
评论 #3845990 未加载
zobzuabout 13 years ago
It's a nice button, but, nothing like have 2 HN, FB, Twitter, G+ buttons.<p>I don't think the "social sharing" idea behind all those buttons is smart at all. It allows for an eventual single winner only, and crap in between (and crap after the winner is "elected" since it wont be cool anymore, everyone will have to have a new button side by side)
alpbabout 13 years ago
I have just installed it to my blog (example: <a href="http://ahmetalpbalkan.com/blog/getting-things-done-for-devel..." rel="nofollow">http://ahmetalpbalkan.com/blog/getting-things-done-for-devel...</a>) however submit button never disappears. I would expect it to show 1 points. Can you show me a page that vote count actually works?
评论 #3844951 未加载
评论 #3844916 未加载
epsabout 13 years ago
&#62; <a href="http://hnbutton.appspot.com/static/hn.js" rel="nofollow">http://hnbutton.appspot.com/static/hn.js</a><p>Why is this .js not on Github?
评论 #3845472 未加载
评论 #3845863 未加载
评论 #3845138 未加载
overshardabout 13 years ago
This has been done a few times before but still, well done. Works very well.