Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a Ruby gem to use the Google Images API?

I need to talk with the Google Images API on my Rails Application. Is there a Ruby gem to do this? I found an old gem that used the deprecated API.

like image 351
Goles Avatar asked Feb 07 '12 19:02

Goles


People also ask

What is RubyGems How does it work?

The RubyGems software allows you to easily download, install, and use ruby software packages on your system. The software package is called a “gem” which contains a packaged Ruby application or library. Gems can be used to extend or modify functionality in Ruby applications.

What is gem in Ruby language?

RubyGems is a package manager for the Ruby programming language that provides a standard format for distributing Ruby programs and libraries (in a self-contained format called a "gem"), a tool designed to easily manage the installation of gems, and a server for distributing them.


2 Answers

There is a gem called google_custom_search_api that uses the newer google custom search API: https://github.com/wiseleyb/google_custom_search_api

You can limit this to image search by specifying image for the searchType parameter, like so:

 results = GoogleCustomSearchApi.search("poker", {"searchType" => "image"})
like image 154
bantic Avatar answered Sep 30 '22 13:09

bantic


Also there is another gem called image_suckr - https://github.com/maurimiranda/image_suckr also you can do somthing similar directly in Google Image Search API

suckr = ImageSuckr::GoogleSuckr.new
suckr.get_image_url({"q" => "car"})

like image 22
woohoou Avatar answered Sep 30 '22 14:09

woohoou