RAA - ruby-google/0.6.0

ruby-google / 0.6.0

Short description: Ruby/Google
Category: Library/WWW
Status: beta
Created: 2002-12-31 15:00:00 GMT
Last update: 2006-02-08 01:38:25 GMT
Owner: Ian Macdonald (Projects of this owner)
Homepage: http://www.caliban.org/ruby/
Download: http://www.caliban.org/files/ruby/ruby-google-0.6.0.tar.gz
License: GPL
Dependency:
None
Description:

Ruby/Google offers a higher-level abstraction of Google's SOAP-driven Web API. It allows you to programmatically query the Google search-engine from the comfort of your favourite programming language, as long as that's Ruby.

The aim of the library is to make the details of the raw data structures returned by the Web API irrelevant, in the process making the API more accessible for everyday use.

The code is fully functional and usable at this time. The interfaces are unlikely to change.

Demonstration programs are included in the archive.

Ruby/Google requires SOAP4R for its SOAP interface to the Google Web API.

Changes in 0.6.0:

A new method, Search#utf8, allows the user to request conversion of query strings from a given source encoding to UTF-8, prior to sending them to Google.

Previous versions of the library had started to fail. It's not clear if changes made to the Google Web API caused this issue. The code has been slightly modified to fix the problem.

Changes in 0.5.1:

No user-visible changes.

Use of Object#type has been replaced by Object#class, since the former generates warnings with Ruby 1.8.

Changes in 0.5.0:

No user-visible changes.

SOAP4R 1.4.8 now has a WSDL driver, so Google's WSDL file can be used directly instead of having to define the underlying methods ourselves. This makes the code simpler and briefer.

Changes in 0.4.2:

Google::Search now deprecates use of the 'oe' and 'ie' parameters, in line with changes made by Google to the Web API on 30th August 2002. If Ruby is run in verbose mode and either of these parameters is used, a warning will be issued.

Changes in 0.4.1:
- No user-visible changes
- Minor code clean-up to aid legibility
- Fixes to RD documentation

Changes in 0.4.0:
- This version of the software introduces slight incompatibilities with previous
releases:

- The directoryCategories member of the Struct::Response returned by
Search.new is now of type Struct::DirectoryCategory. A
Struct::DirectoryCategory contains two attributes, fullViewableName and
specialEncoding.

- For consistency with the above change, the directoryName member of the
Struct::ResultElement returned by ResultElement.new was renamed
fullViewableName. The directoryEncoding member of the the
Struct::ResultElement was renamed specialEncoding.

The following new features have been added:

- A new class method, Search.query_length_ok?, was added. This takes a String
parameter and returns either true or false, depending on whether or not the
query string is within the limits specified by the Google Web API.

- A new class method, Search.query_words_ok?, was added. This takes a String
parameter and returns either true or false, depending on whether or not the
number of words in the query string is within the limits specified by the
Google Web API.

- A new class method, Search.query_sites_ok?, was added. This takes a String
parameter and returns either true or false, depending on whether or not the
number of 'site:' restict clauses in the query string is within the limits
specified by the Google Web API.

- A new class method, Search.query_ok?, was added. This encapsulating method
takes a String parameter and returns either true or false, depending on
whether or not the query string passes all of the tests imposed by the
Search.query_length_ok?, Search.query_words_ok? and Search.query_sites_ok?
methods.

- A new class method, Search.restrict, was added. This takes two parameters,
type and *data, and assembles a query term consisting of a restrict type and
its parameters.

If type is phrase, a double-quoted copy of each string passed as *data is
returned.

If type is daterange, the first three parameters of *data must be the year,
month, and day of a start date. The next three parameters, if given, form the
year, month, and day of an end date. If these last three parameters are not
given, today's date will be substituted.

Other supported restrict types are site, intitle, allintitle, inurl,
allinurl, allintext, allinlinks, filetype, notfiletype, info, link, related,
cache, include and exclude. Some of these names differ slightly from those
given in section 2.2 of APIs_Reference.html in order to simplify their use
and memorability.

When the restrict type is neither phrase nor daterange, it's possible to
assemble multiple restrict terms of the same type in a single call to
Search#restrict, by simply extending the parameter list when you invoke the
method.


Changes in 0.3.0:
- The data structure returned by Search#search has changed. A Struct::Response is now returned, rather than being placed in the instance variable @response. In addition, the resultElements member of the Struct::Response returned by Search#search contains Struct::ResultElement objects. These no longer use the instance variable @attribute.
- Superfluous class variables have been removed.
- Numerous improvements have been made to the documentation.


Changes in 0.2.0:

- add HTTP proxy support
- documentation referred to 'results' hash. Should have been 'resultElements'
- the 'search' method now returns a Struct instead of a hash
- the 'resultElements' element of the Struct returned by the 'search' method is
- now also a Struct, not a hash
- track defined methods using class variables, in order to avoid method
- redefinition warnings in SOAP4R when running Ruby with -w
- added new example program: tkspell.rb
- make example programs pull key from ~/.google_key

Versions: [0.6.0 (2006-02-08)] [0.5.1 (2003-05-20)]

Edit this project (for project owner)

back to RAA top