Hacker News new | past | comments | ask | show | jobs | submit login
Show HN: Hacker News Instant (3 hour project) (hninstant.com)
91 points by vnorby on June 5, 2011 | hide | past | favorite | 37 comments



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.

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


This specific bug should be fixed now. Sorry about crashing your browsers.


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


I think you're being a little unreasonable. "Three hour project," click at your own risk.


I don't think the bug makes it any less noteworthy.


Shit happens; the author fixed it and apologized.


Little known fact: SearchYC does instant search if you add &instant=true to the URL: http://searchyc.com/hacker+news?sort=by_date&instant=tru...

It's not enabled by default because it's not as useful without autocomplete.


Awesome, did not know that. Would be cool if you all made this default when you get SearchYC back up and running.


I thought you were shutdown by Comcast, nice to see you're back


It is still down here.


It's been a rough week. Hopefully things will return to normal once DNS propagates.


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.


I 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/


I like your implementation/UI better... very little change from the existing site!


yes. but please add a bit of left margin to the search box.


Maybe hide the "0 points" in every submission until pg brings visible karma back?


Done, thanks.


I 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!


I'm sorry - what I've done now is only updated the history/hashtag when hitting enter, similar to Google Instant search.


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.

Will wait for MVP2.0


Love it. Give me the possibility to search titles only (a checkbox) and this will be my favorite search tool for HN.


Done, there ya go.


"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)


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


you should cache local results, so as I type:

    drop > dropb > dropbo > dropbox
I get no white screen in between, rather previous list filtered


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


We definitely want to add autocomplete to ThriftDB.


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


Interesting. Is it normal that the browser's back button is essentially rendered useless after a query or two?


Back button support should be there (for most browsers) :)


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


Upvote.


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


Nice work. Could you highlight queries?


Nice work Vib!!



Why such a negative approach? Wouldn't it be more useful to specify how to reproduce the problem, to let the author fix it?




Consider applying for YC's W25 batch! Applications are open till Nov 12.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: