php 如何使用 Google SpreadSheets API 向应用程序提供数据?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1314001/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to use the Google SpreadSheets API to feed data to an application?
提问by edt
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_guide_php.html
我已经通读了 Google Spreadsheets API PHP 文档。所有示例都使用 Zend,我无法使用。请参阅此页面:http: //code.google.com/apis/spreadsheets/docs/1.0/developers_guide_php.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?
如何使用带有 curl(或其他)的 PHP 和 Google 电子表格 API 从 Google 电子表格文档中获取数据?
It's my understanding that the data will be delivered in XML format. From there, I'll use PHP to manipulate it.
据我了解,数据将以 XML 格式交付。从那里,我将使用 PHP 来操作它。
采纳答案by Alix Axel
回答by Carlton Gibson
The Zend Gdata implementation is the officialPHP 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... :-)
Zend Gdata 实现是Google API的官方PHP 库。我猜没有多少答案,但我不得不问,你为什么不直接使用它?(似乎您正在重新发明轮子...... :-)
回答by Robert DeBoer
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.
从我所看到的以及大多数其他 Google API 的工作方式来看,电子表格 API 以 URL 为中心。您制定一个 URL 并返回一个 xml 响应。然而,对于这个特定的产品,大多数支持是针对 Zend 框架实现的。您总是可以下载 Zend 组件并对其进行逆向工程以使其工作。
回答by Phil Bogle
The Google Spreadsheets Data API is documented here.
此处记录了 Google 电子表格数据 API。
http://code.google.com/apis/spreadsheets/docs/1.0/developers_guide_protocol.html
http://code.google.com/apis/spreadsheets/docs/1.0/developers_guide_protocol.html
It's a REST API so you just need appropriately formatted GETS and POSTS as described in the docs.
它是一个 REST API,因此您只需要按照文档中的说明正确格式化 GETS 和 POSTS。

