Hilighting referring search engine text in web pages

On some random blog I arrived on via a search engine,
I noticed that the page had hilighted all the words
that were part of my query. This is awesome.

I wonder if this functionality could be added as a post-processing
step for all web pages before they are sent to the user.
(an Apache module?) The logic could be quite simple:

  if( http_referer_exists &&
      http_referer_is_search_engine ) {
    query = get_query_from_referer()
    foreach word in query {
     response =~ s/word/<div name=hilite>word</div>/g;
    }
  }

Leave a Reply

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