Endless Google Search

April 2009 Update: Originally, I had an live example of this running. However, the Google API doesn’t seem to work any more (it was discontinued over two years ago). In any case, there are better examples online now. Try Live Search Images or Terrel Dent’s blog. I would make the source available, but it was an weekend hack and there isn’t much to it.

I felt like coding today, so I put together a little hack from an idea I have had for a while. What I came up with is a web search (powered by Google), that loads new search results as you scroll the page down. Try it, it’s actually pretty cool.

Here is how it works: there is a large div element at the bottom of the page just to take up space. When it comes onto the screen, an ajax request is made to the server to get the next 10 results from Google. The requests are made through Google’s SOAP api, which is no longer available, but I had an old API key so I was able to get it to work. I had all the client stuff working within an hour, but Google’s API took a while to figure out. Google uses SOAP, which is powerful but hard to code for compared to a simple GET API. It took me a couple of hours to get the server-side stuff working but it is still a hack, so don’t be surprised if you get an error or some unexpected behaviour.

It was designed for FireFox/Mozilla browsers. The only other browser I have tried it with is IE, which it does not work with. So if you are using Internet Explorer, you won’t see anything interesting.

Try it here

This entry was posted in PHP, Web Apps. Bookmark the permalink.

0 Responses to Endless Google Search

  1. Well done man. That’s pretty neat… although the results would get a little unruly after awhile. Perhaps there’s a way to cut off the top-most 20 results once they’ve been scrolled past?

  2. trk7 says:

    Pretty cool.Works on my Safari/Mac.There is a pear package available to make req to Google’s SOAP API here: http://pear.php.net/package/Services_Google , works 90% of the time.

  3. Paul Butler says:

    Thanks Elias and trk7.

    Cutting off the results after a while is a good idea, it wouldn’t be too hard to change and it would make it harder for me to go over my daily API request limit. But then I couldn’t call it endless Google :).

    I wish I knew about the PHP api before hand, but at least I got immersed in SOAP this way (no pun intended :D). The SOAP code I used is a huge hack that would never work in a real project.

  4. tayyeb says:

    dear paul
    good work but i see it have a simple bug that in small results the script repeat the google result and user cant understand that it get finished!!

  5. Very nice little application you’ve created here. The question is whether visually it won’t bug people that they’ve got an endless page… like as a psychological thing. Also makes the value of seo look questionable to a certain extent, since there’s no effort involved going to “page 2″ or “3″…

    keep up the good stuff!

  6. Paul Butler says:

    Google critic, I know what you mean, it does feel a bit uncomfortable to have no end. It is convenient though.

    I think that even if Google or another search engine were to do this, they would still find that the majority of clicks come from the first page. But I think you are right, it would change the dynamics of SEO a bit.

  7. Paul Butler says:

    Cool, Microsoft added this feature to their newly improved Live Image Search.

    I’m sure they came up with it independently of me though. I just hope they don’t try to patent it :).

  8. Peter Kao says:

    Wow, this is a really creative idea!

    I like it a lot, enough to use it when I’m doing research! **Bookmarked**

    Peter Kao
    http://peterkao.com

  9. Pingback: Endless Google Search Results | Mind of a Young Undergrad Entrepreneur

  10. Rajesh Kumar says:

    Interestingly, Terrill has had this feature on his own blog for quite some time now: http://www.terrill.ca/

  11. Paul Butler says:

    Yeah, I’ve noticed that on Terrill’s site. I spent the better part of an afternoon trying to read until the bottom of his main page, before I clued in :).

  12. Terrill says:

    I use a slightly different approach on my site. Instead of adding blank space at the bottom of the page I initiate requests based on the height and position of the scrollbar so that they appear more transparently.

    R.I.P. “Next page” buttons :)

  13. Terrill says:

    If you try hard it can work in IE also.

  14. FYI, I implemented a Google mod (using Greasemonkey) to have endless scrolling on the results page.
    http://blog.monstuff.com/archives/000337.html

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>