From: Paul Duncan Date: 2003-02-16T07:35:48+09:00 Subject: [ANN?] DBD-Google-Ruby pre-20030215 (was Re: DBD:Google) --LXx4g46d83wF7unj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable * Dave Thomas (dave@pragmaticprogrammer.com) wrote: > From Rael Dornfest's blog (http://www.raelity.org/) we have > DBD::Google is a Perl module providing database-like interaction with=20 > the Google Web API . Like I said before, that's damn cool. So here's my preliminary implmenetation in Ruby (using Rubu-Google): http://www.pablotron.org/download/dbd-google-ruby-pre-20030215.tar.gz And here's a sample script: -- #!/usr/bin/ruby require 'dbi' # read user key user =3D File.open("#{ENV['HOME']}/.google_key") {|kf| kf.readline.chomp} # connect to google dbh =3D DBI::connect('dbi:Google:google', user, '') # prepare query s =3D dbh.prepare('select title,url from google where q =3D "pablotron"') s.execute # fetch results while row =3D s.fetch puts row.join ','=20 end -- # ./test.rb=20 Pablotron: News,http://www.pablotron.org/ Pablotron: Imlib2-Ruby,http://www.pablotron.org/software/imlib2-ruby/ Pablotron: Reviews: Nautilus PR2,http://www.pablotron.org/reviews/na= utilus-PR2/ Pablotron: Xmms-Ruby,http://www.pablotron.org/software/xmms-ruby/ Pablotron: FAM-Ruby,http://www.pablotron.org/software/fam-ruby/ Pablotron: Bash Tweaks,http://www.pablotron.org/software/bash_tweaks/ Pablotron: Reviews : Michael Jackson's Moonwalker,http://www.pablotr= on.org/reviews/moonwalker/ Pablotron: Resume,http://www.pablotron.org/resume/ Pablotron: About,http://www.pablotron.org/about/ Pablotron: CVS,http://www.pablotron.org/cvs/ I still have to do some documentation, and improve the query string parsing a little bit, but that shouldn't take more than a couple of days. --=20 Paul Duncan pabs in #gah (OPN IRC) http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562 --LXx4g46d83wF7unj Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+TsDBzdlT34LClWIRAr/qAKCg8pg9ftlNt1s07YMQPINF+BgMKACgr1AL ebxfXmf1aYExeDoZBR0Amig= =5VoY -----END PGP SIGNATURE----- --LXx4g46d83wF7unj--