wiseleyb/google_custom_search_api — pull request #3 by drKreso (2013-06-17 18:31:45+00:00)
Title: 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.