PHP with Google API and B2 Blog
hatch
I just added a Google related links query to individual post on hatch.org (If you’re viewing this as an individual post you should see it below the weblog related links. If not, just click on the title of this post).
It was fairly easy to implement, thanks to Sebastian Bergmann PHP Google SOAP class, which provides an interface to Google’s Web Services API. The class also requires PEAR::SOAP package, which puts it all together.
Once they were installed, all I needed to do was create a function to output the query results from the call to the SOAP class, which is then called from the comments page. I’m sure I could put together a HOW-TO if anyone is interested.
However, I’m a little concerned with the performance. The embedded SOAP query adds a considerable lag to the page load. Yet once the page is rendered and JPCache caches it, any subsequent page loads are fast. Of course that’s only until the cache expires.
I suppose I could increase the cache time-out and/or cache the Google SOAP results or even do some clever client-side data-binding or simply have the results load into an iframe …
But maybe I’ll just have that sip of Scotch and go to bed instead :-)