[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnumed-devel] google api
From: |
Tony Lembke |
Subject: |
[Gnumed-devel] google api |
Date: |
Sun, 9 Mar 2003 21:27:50 +1100 |
I appreciate this is somewhat off topic, but it may have a use in
GnuMED at some future time, and it is fairly cool, and I didn't have
any one else to tell, and perhaps some of the list haven't seen it. It
does fit in with our general principle of 'sharing knowledge', and is a
nice model for distributing data. If there was a drug database, or
patient handout materials available in a similar way it would be ' a
good thing'.
I have been experimenting with the google api,
http://www.google.com/apis/index.html
This allows applications to perform a Google search and receive the
results using SOAP. It is pretty neat. A python implementation
(pygoogle) is available.
http://python.scripting.com/directory/13/soap/services/googleApi
http://diveintomark.org/projects/#pygoogle
I set it up on php. Once libraries are installed, a php script to
display search results is as simple as
require_once('SOAP/SOAP_Google.php') ;
$google =new SOAP_Google('yourAuthenticationKey');
$result= $google -> search (array( 'query' => 'gnumed' ));
if( false !== $result){
print "There were ".$result->estimatedTotalResultsCount ." results<p>";
$elements=$result->resultElements;
foreach ($elements as $r) {
print "<li><a href=" . $r->URL. ">" .$r->title . "</a><br>\r";
}
print "<pre>";
print_r($result);
print "</pre>";
}else{
echo 'Query failed.' ;
}
Regards,
Tony Lembke