google_search_cse
A Ruby library to integrate Google Custom Search Engine (CSE) into Rails applications. Lets you add Google-powered search to your site using your own custom search engine ID.
Installation
Add this line to your Gemfile:
gem 'google_search_cse'
Then run:
bundle install
Setup
- Create a Custom Search Engine at programmablesearchengine.google.com
- Note your Search Engine ID (cx)
- Enable the Custom Search JSON API in Google Cloud Console and grab an API key
Usage
search = GoogleSearchCse.new
results = search.query("YOUR_API_KEY", "YOUR_CX_ID", "ruby on rails")