Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

google_search

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google_search

  • 1.2.0
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= Google Search

Tiny wrapper for Google Search APIs.

== Usage

require 'google_search'

GoogleSearch.web :q => "pink floyd"

=> {"responseData"=>{"results"=>[{"GsearchResultClass"=>"GwebSearch", "title"=>"Pink Floyd | The Official Site", "url"=>"http://www.pinkfloyd.com/", "cacheUrl"=>"http://www.google.com/search?q=cache:iFN1qQtvV7gJ:www.pinkfloyd.com", "content"=>"", "visibleUrl"=>"www.pinkfloyd.com"...yaddayadda

You can also search videos, images, books etc. by calling GoogleSearch.[SEARCH TYPE] (e.g. GoogleSearch.images :q => "apple pie")

For documention on options and response formats see http://code.google.com/intl/hr/apis/ajaxsearch/documentation/reference.html#_intro_fonje

=== Default options

You may specify default options that go into every request. Usually you'll put your API key here.

GoogleSearch.default_options = { :key => "my-key", :hl => "hr" }

=== Paginated search

GoogleSearch.with_pages(1..5) do |search| search.images(:q => "moon") end

This will do search 5 times, each time given a different page (1..5). Useful for getting more results at once.

=== Handling errors

On invalid response a GoogleSearchError is raised, describing the error.

== Copyright

Copyright (c) 2010 Sasa Brankovic. See LICENSE for details.

FAQs

Package last updated on 21 Nov 2010

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc