如何在没有 Zend Gdata 库的情况下使用 PHP 将数据保存在非公开的谷歌电子表格中?
如何在不使用 Zend Gdata lib 的情况下在 PHP 中将数据保存在非公开的 Google 电子表格中? 我无法使用 Zend libs,正如 google 教程中所示,因为我运行脚本的 php 服务器是 php v. 5.0.4。 我尝试使用 cUrl 找到解决方案,但当 doc 不公开时,我不能忽略身份验证问题。 我该怎么做呢?如果有人尝试过,请分享解决方案。
How can I save data in unpublic google spreadsheet in PHP without using Zend Gdata lib?
I can't use Zend libs, as it's shown on google tutorials, because the php server on which I'm running the script is php v. 5.0.4.
I tried to find a solution using cUrl, but I can't omit the problem with authentication when doc is unpublic.
How can I do it? If anyone has attempted it, please share the solution.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我已经找到了使用curl 并通过为谷歌电子表格创建表单的解决方案。
对于准备好的电子表格,您必须创建一个表单,不带选项:需要登录才能查看此表单和自动收集受访者的用户名。
然后使用 fe firebug 检查表单 post uri 和 post 数据,并将其用于以下脚本:
可能不是最完美的解决方案,但它有效。 :)
I have found out solution using curl and by creating a form for the google's spreadsheet.
For prepared spreadsheet you have to create a form, without options: Require sign-in to view this form and Automatically collect respondent's username.
Then check, using f.e. firebug, the form post uri and post data and use it to following script:
May not be the most perfect solution but it works. :)
这是一个面向对象的 php 类,用于将数据发送到 Google 文档电子表格 - http://code.google.com/p/php-form-builder-class/source/browse/trunk/includes/class。 Spreadsheet.php?spec=svn384&r=384
使用 cUrl 代替 Zend 的 GData 库。您可以在下面找到示例实现。请记住将测试设置(“my_google_email”、“my_google_password”等)替换为您的具体信息。
传递给 add 方法的关联数组的键需要与您用来收集数据的电子表格的列标题匹配。
Here is an object-oriented php class for sending data to a Google Docs Spreadsheet - http://code.google.com/p/php-form-builder-class/source/browse/trunk/includes/class.spreadsheet.php?spec=svn384&r=384
cUrl is used instead of Zend's GData lib. You can find a sample implementation below. Remember to replace the test settings ("my_google_email", "my_google_password", etc) with your specific information.
The keys of the associative array passed to the add method need to match the column headers of the spreadsheets you're using to collect the data.
您可以使用普通 HTTP 请求访问 GData API;图书馆只是让这对你来说更容易。基本上,您最终只是重写了您想要使用的库的部分。
请参阅协议文档。
You can access the GData APIs using ordinary HTTP requests; a library just makes this easier for you. You basically just end up rewriting the bits of the library you want to use.
See the protocol documentation.