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.

Show HN: Hacker News Instant (3 hour project)

91 pointsby vnorbyalmost 14 years ago

14 comments

kwamenum86almost 14 years ago
Looks good. Except when you type a single space character the app enters into an infinite loop making it very difficult to do anything else in the browser (Chrome). Even navigating the window to a different page is impossible.<p>[Edit] Scratch that. Typing anything followed by a space character tends to make things crash. Why would this happen? I find this bug interesting. Let me know what the problem was when you fix it.<p>[Edit2] Okay looks like the problem may be with anything that needs to be url encoded.<p>[Edit3] I think the problem comes down to your call to encodeURIComponent in your search function and the behavior when the hash changes. Basically, we enter the search function when the hash changes. But then you call encodeURIComponent and assign the result to the hash. If the query contains characters that need to be escaped then the new value is different (meaning the hash changes), which means that your search function is going to get called ad infinitum.<p>In order to fix this I think you need to do two things. 1) Keep track of the in flight request unencoded and 2) if your search function is triggered by a hash change decode the query and compare it to your in flight request. If they are the same then you can bail out of the search function early. Otherwise you should cancel the in flight request and launch a new one.
评论 #2621331 未加载
评论 #2621265 未加载
评论 #2621252 未加载
评论 #2621291 未加载
chengmialmost 14 years ago
Little known fact: SearchYC does instant search if you add &#38;instant=true to the URL: <a href="http://searchyc.com/hacker+news?sort=by_date&#38;instant=true" rel="nofollow">http://searchyc.com/hacker+news?sort=by_date&#38;instant=tru...</a><p>It's not enabled by default because it's not as useful without autocomplete.
评论 #2621404 未加载
评论 #2621391 未加载
vnorbyalmost 14 years ago
Using new HNsearch.com APIs, designed, developed, launched in 3 hours. More coming, this is about as MVP as it gets. Same ranking algorithm as used on HNSearch.com. BTW, hidden feature...you can double click words in search results to load a search for that term.
nicklovescodealmost 14 years ago
I built the same thing, was planning on finishing the app and buying the domain tomorrow.<p>Oh well, this is better than what I would have had anyway.<p><a href="http://nickcammarata.com/hninstant/" rel="nofollow">http://nickcammarata.com/hninstant/</a>
评论 #2621353 未加载
BoppreHalmost 14 years ago
Maybe hide the "0 points" in every submission until pg brings visible karma back?
评论 #2621375 未加载
planckscnstalmost 14 years ago
I found its messing with history incredibly annoying. Here's why...<p>Every single letter typed creates a new history item. It got to the point where so many history items were added that HN was pushed out of my history: I couldn't use "back" to get back to HN. I had to type in the URL to get to HN, then I had to find the comments page to get back here again to see the discussion.<p>I continued on looking at other HN stories. Once, I went back too far and landed on the HNI page again. I typed "L" as one does in Vimperator and Pentadactyl to go forward and get back to HN. The only problem was the text box stole my input, this resulted in a new query and a new history item, erasing, once again, HN's history item. I had to (again) type the URL to get here!
评论 #2623047 未加载
asanwalalmost 14 years ago
Interesting idea but on my first query, it locked up Chrome on me and went absolutely batsh1t crazy. Had to shut down Chrome and relaunch it.<p>Will wait for MVP2.0
Kilimanjaroalmost 14 years ago
Love it. Give me the possibility to search titles only (a checkbox) and this will be my favorite search tool for HN.
评论 #2621367 未加载
askar_yualmost 14 years ago
"3 hour project" - I wonder what the author's intent is to point out that it took him 3 hours to implement? (I've equally been curious about the ones where people share their <i>weekend</i> projects and remark it explicitly)
评论 #2622327 未加载
tzuryalmost 14 years ago
you should cache local results, so as I type:<p><pre><code> drop &#62; dropb &#62; dropbo &#62; dropbox </code></pre> I get no white screen in between, rather previous list filtered
评论 #2621364 未加载
hacklyalmost 14 years ago
Interesting. Is it normal that the browser's back button is essentially rendered useless after a query or two?
评论 #2621171 未加载
stuntgoatalmost 14 years ago
Nice work. Could you highlight queries?
comatose_kidalmost 14 years ago
Nice work Vib!!
ujjvalaalmost 14 years ago
No thank you. <a href="http://i.imgur.com/bywAE.png" rel="nofollow">http://i.imgur.com/bywAE.png</a>
评论 #2621259 未加载