google_custom_search_api
google_custom_search_api copied to clipboard
Choosing from multiple engines
Hi nice library you have.
I had a need to use multiple search engines and single constant was not working for me.
This would be alternative syntax: GOOGLE_ENGINES = { :japanese => { "GOOGLE_API_KEY" => "zz", "GOOGLE_SEARCH_CX" => "yy" }, :chinese => { "GOOGLE_API_KEY" => "bb", "GOOGLE_SEARCH_CX" => "ee" } }
and then on search:
GoogleCustomSearchApi.search(title, :engine_keys => GOOGLE_ENGINES[:japanese])
Sorry about my editor being a whitespace nazzi, the changes are only in url method.