Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choosing from multiple engines #3

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

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