views:

1792

answers:

4

I've read through the Google Spreadsheets API PHP documentation. All examples are using Zend, which I cannot use. See this page: http://code.google.com/apis/spreadsheets/docs/1.0/developers%5Fguide%5Fphp.html

Does anybody know a simple example of the following:

How can I use PHP w/ curl (or whatever) and the Google Spreadsheets API to get the data from a Google Spreadsheets Doc?

It's my understanding that the data will be delivered in XML format. From there, I'll use PHP to manipulate it.

+1  A: 

From what I can see and how most of the other Google API work, the Spreadsheet API is centered around URLs. You formulate a URL and an xml response is returned. It seams that for this particular product however, most the support is for the Zend framewok implementation. You could always download the Zend component and reverse engineer it to work.

Robert DeBoer
I'm trying to avoid reverse engineering. I'm searching for a bare-bones example of how it could work without any PHP framework. For example, how to make it work with curl.
You could reverse engineer to find out the URLs needed and then you would know what you need to create and send to Google
Robert DeBoer
A: 

The Google Spreadsheets Data API is documented here.

http://code.google.com/apis/spreadsheets/docs/1.0/developers%5Fguide%5Fprotocol.html

It's a REST API so you just need appropriately formatted GETS and POSTS as described in the docs.

Phil Bogle
Yes, thank you. I'm looking for a bare-bones type of example that does what you are saying.
+1  A: 

Google is your friend! ;)

Alix Axel
Thanks Eyze. This example is exactly what I was looking for: http://sim.plified.com/2008/09/14/accessing-google-spreadsheet-with-php/
A: 

The Zend Gdata implementation is the official PHP library for Google APIs. Not much of an answer I guess but I have to ask, why wouldn't you just use it? (It seems like you're reinventing the wheel... :-)

Carlton Gibson
Yes, and ZEND components are pretty encapsulated. You could use ONLY the zend Gdata module and nothing else from zend.
Byron Whitlock