DBD:Google

From Rael Dornfest’s blog (http://www.raelity.org/) we have

DBD::Google is a Perl module providing database-like interaction with
the Google Web API .

use DBI;
my $dbh = DBI->connect(“dbi:google:”, $KEY);
my $sth = $dbh->prepare(
qq[ SELECT title, URL FROM google WHERE q = “hacks” ]
);
while (my $r = $sth->fetchrow_hashref) {

Now that is cool. :slight_smile: :slight_smile:

···

From Rael Dornfest’s blog (http://www.raelity.org/) we have

DBD::Google is a Perl module providing database-like interaction with
the Google Web API .

use DBI;
my $dbh = DBI->connect(“dbi:google:”, $KEY);
my $sth = $dbh->prepare(
qq[ SELECT title, URL FROM google WHERE q = “hacks” ]
);
while (my $r = $sth->fetchrow_hashref) {


Paul Duncan pabs@pablotron.org pabs in #gah (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562

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:

···

From Rael Dornfest’s blog (http://www.raelity.org/) we have

DBD::Google is a Perl module providing database-like interaction with
the Google Web API .


#!/usr/bin/ruby

require ‘dbi’

read user key

user = File.open(“#{ENV[‘HOME’]}/.google_key”) {|kf| kf.readline.chomp}

connect to google

dbh = DBI::connect(‘dbi:Google:google’, user, ‘’)

prepare query

s = dbh.prepare(‘select title,url from google where q = “pablotron”’)
s.execute

fetch results

while row = s.fetch
puts row.join ‘,’
end

./test.rb

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/nautilus-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.pablotron.org/reviews/moonwalker/
Pablotron: Resume,http://www.pablotron.org/resume/
Pablotron: About,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.


Paul Duncan pabs@pablotron.org pabs in #gah (OPN IRC)
http://www.pablotron.org/ OpenPGP Key ID: 0x82C29562

“Paul Duncan” pabs@pablotron.org wrote in message
news:20030215223545.GP10858@ns.snowman.net

dbi-google …

Looks nice with selecting fields from Google - but what is the exact point
with the transactions?

Mikkel