Note that there are some explanatory texts on larger screens.

plurals
  1. PONeed help: Reading my Google spreadsheet, keeping it private
    text
    copied!<p>Getting super frustrated trying to get this working. Basically this is for a site (x10hosting.com) where I can't include the zend gdata framework, so I'm trying to use the Google Data API with php cURL to access it. The most I've been able to do is return a list of the supplied usernames worksheets, using this script:</p> <pre><code>&lt;?php // Construct an HTTP POST request $clientlogin_url = "https://www.google.com/accounts/ClientLogin"; $clientlogin_post = array( "accountType" =&gt; "HOSTED_OR_GOOGLE", "Email" =&gt; "", //username "Passwd" =&gt; '', //password "service" =&gt; "writely", "source" =&gt; "your application name" ); // Initialize the curl object $curl = curl_init($clientlogin_url); // Set some options (some for SHTTP) curl_setopt($curl, CURLOPT_POST, true); curl_setopt($curl, CURLOPT_POSTFIELDS, $clientlogin_post); curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_ANY); curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); // Execute $response = curl_exec($curl); // Get the Auth string and save it preg_match("/Auth=([a-z0-9_\-]+)/i", $response, $matches); $auth = $matches[1]; echo "The auth string is: ".$auth; // Include the Auth string in the headers // Together with the API version being used $headers = array( "Authorization: GoogleLogin auth=".$auth, "GData-Version: 3.0", ); // Make the request $key = ; curl_setopt($curl, CURLOPT_URL, "https://spreadsheets1.google.com/ccc?key=$key"); curl_setopt($curl, CURLOPT_HTTPHEADER, $headers); curl_setopt($curl, CURLOPT_POST, false); $response = curl_exec($curl); curl_close($curl); var_dump($response); // Parse the response $response = simplexml_load_string($response); // Output data foreach($response-&gt;entry as $file) { echo "File: " . $file-&gt;title . "&lt;br /&gt;"; echo "Type: " . $file-&gt;content["type"] . "&lt;br /&gt;"; echo "Author: " . $file-&gt;author-&gt;name . "&lt;br /&gt;&lt;br /&gt;"; } ?&gt; </code></pre> <p>But I can't figure out a way to use this to access one specific worksheet. Please help, this is driving me nuts.</p> <p><strong>EDIT:</strong> Following DASPRiD's advice gives me this error-></p> <blockquote> <p>Notice: Zend_Loader::Zend_Loader::registerAutoload is deprecated as of 1.8.0 and will be removed with 2.0.0; use Zend_Loader_Autoloader instead in /home/c3webdev/public_html/library/Zend/Loader.php on line 266</p> <p>Warning: require_once(Zend/Loader/Autoloader.php) [function.require-once]: failed to open stream: No such file or directory in /home/c3webdev/public_html/library/Zend/Loader.php on line 267</p> <p>Fatal error: require_once() [function.require]: Failed opening required 'Zend/Loader/Autoloader.php' (include_path='/home/c3webdev/public_html/library:.:/usr/lib/php:/usr/local/lib/php') in /home/c3webdev/public_html/library/Zend/Loader.php on line 267</p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload