5 ms·
Show HN: Hacker News Instant (3 hour project)
- vnorby 15y agoUsing 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.
- agilo 15y agoInteresting. Is it normal that the browser's back button is essentially rendered useless after a query or two?
- vnorby 15y agoBack button support should be there (for most browsers) :)
- robryan 15y agoIt's on a letter by letter basis though, maybe best to only update the browser hash say after a second or more of no letters added to the search bar.
- lightyrs 15y agoUpvote.
- vnorby 15y agoWhat I've done for now is only updated the history/hashtag when hitting enter, similar to Google Instant. They have some other conditions in there as well, but there's not a whole lot of a use-case on here for wanting to use the back button within a search query.
- ujjvala 15y agoNo thank you. http://i.imgur.com/bywAE.png http://i.imgur.com/bywAE.png
- eliben 15y agoWhy such a negative approach? Wouldn't it be more useful to specify how to reproduce the problem, to let the author fix it?
- kwamenum86 15y agoLooks 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. [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. [Edit2] Okay looks like the problem may be with anything that needs to be url encoded. [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. 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.
- deleted 15y ago[deleted]
- deleted 15y ago[deleted]
- garb 15y agohow come this post is still on top with such a serious bug? Hitting space makes it enter into infinite loop. It crashed my browser while I was in middle of something important.
- kwamenum86 15y agoI don't think the bug makes it any less noteworthy.
- deleted 15y ago[deleted]
- asanwal 15y agoInteresting 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. Will wait for MVP2.0
- Kilimanjaro 15y agoLove it. Give me the possibility to search titles only (a checkbox) and this will be my favorite search tool for HN.
- vnorby 15y agoDone, there ya go.
- BoppreH 15y agoMaybe hide the "0 points" in every submission until pg brings visible karma back?
- vnorby 15y agoDone, thanks.
- comatose_kid 15y agoNice work Vib!!
- chengmi 15y agoLittle known fact: SearchYC does instant search if you add &instant=true to the URL: http://searchyc.com/hacker+news?sort=by_date&instant=true http://searchyc.com/hacker+news?sort=by_date&instant=tru... It's not enabled by default because it's not as useful without autocomplete.
- nicklovescode 15y agoI built the same thing, was planning on finishing the app and buying the domain tomorrow. Oh well, this is better than what I would have had anyway. http://nickcammarata.com/hninstant/ http://nickcammarata.com/hninstant/
- martinshen 15y agoI like your implementation/UI better... very little change from the existing site!
- nrbafna 15y agoyes. but please add a bit of left margin to the search box.
- tzury 15y agoyou should cache local results, so as I type: drop > dropb > dropbo > dropbox I get no white screen in between, rather previous list filtered
- kwamenum86 15y agoBased on the way the search API works I don't think this is feasible. "dropb" is not a token that the system recognizes as being part of "dropbox" so I think dropb essentially returns no results. It would be nice if they had some sort of autocomplete functionality. That is how Google Instant works- it makes an educated guess at what your query will be and uses that rather than using the partial query. It's pretty effective much of the time. Seems like ThriftDB is still in a pretty early stage of development so I doubt that they support this. But autocomplete is a solved problem so I'd be surprised if it doesn't make it in at some point.
- andres 15y agoWe definitely want to add autocomplete to ThriftDB.
- kwamenum86 15y agoYeah I feel like you can't have true instant search without autocomplete. Lots of people don't realize that the reason Google's instant search is effective is that they can tell what you are going to type before you finish typing it. Autocomplete would be huge. You guys can probably do a pretty effective version right now but I imagine data about what people are searching for allows you to create a better autocomplete feature. And that data only comes with time.
- stuntgoat 15y agoNice work. Could you highlight queries?
- planckscnst 15y agoI found its messing with history incredibly annoying. Here's why... 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. 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!
- vnorby 15y agoI'm sorry - what I've done now is only updated the history/hashtag when hitting enter, similar to Google Instant search.
- askar_yu 15y 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 weekend projects and remark it explicitly)
- zbanks 15y agoBoth signify that the project was done quickly & may have bugs. Also, they aren't necessarily attempting to turn the project into a business, or even make money off the project. It's a warning. They aren't looking for startup advice, they just want to show a (hopefully) helpful project that may have a few bugs.