<commit_before>h2. SearchSniffer

Simple plugin to sniff inbound search terms from popular search engines

h3. Installation

Installation is easy from "Github":http://github.com/squeejee/search_sniffer/tree

	script/plugin install git://github.com/squeejee/search_sniffer.git


h3. Usage


	class ApplicationController < ActionController::Base
		before_filter :sniff_referring_search
		
		...
	end
	
The plugin populates the @@referring_search@ object containing info that can be passed to a keyword highlighter or internal site search engine to pull related content.
 
  # http://www.google.com/search?q=ruby+on+rails+houston&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a
	@referring_search.search_terms
	 => "ruby rails houston" 
	@referring_search.raw
	 => "ruby on rails houston"
	@referring_search.engine
	 => "google"

Copyright (c) 2008 Squeejee, released under the MIT license<commit_msg>Updated README.textile, commented lib<commit_after>h2. SearchSniffer

Simple plugin to sniff inbound search terms from popular search engines

h3. Installation

Installation is easy from "Github":http://github.com/squeejee/search_sniffer/tree

	script/plugin install git://github.com/squeejee/search_sniffer.git


h3. Usage


	class ApplicationController < ActionController::Base
		before_filter :sniff_referring_search
		
		...
	end
	
The plugin populates the @@referring_search@ object containing info that can be passed to a keyword highlighter or internal site search engine to pull related content. For an HTTP referer of @http://www.google.com/search?q=ruby+on+rails+houston&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a@@
 
  
	@referring_search.search_terms
	 => "ruby rails houston" 
	@referring_search.raw
	 => "ruby on rails houston"
	@referring_search.engine
	 => "google"

Copyright (c) 2008 Squeejee, released under the MIT license
{'fraction_non_alphanumeric': 0.09201480698043363, 'fraction_numerical': 0.009518773135906928, 'mean_word_length': 5.103225806451613, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5153379', 'n_tokens_mistral': 658, 'n_tokens_neox': 583, 'n_words': 161}