Skip to content

Conversation

@drKreso
Copy link

@drKreso drKreso commented Jun 17, 2013

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant