You are viewing an old revision of this post, from June 26, 2015 @ 01:05:20. See below for differences between this version and the current revision.

Using Google Spreadsheets as a CMS with PHP

As seen here: http://elikirk.com/using-google-spreadsheets-as-a-cms-with-php/

Setup a Published Google Spreadsheet

  1. Create a Google spreadsheet, then fill in the data in your spreadsheet with an identifier in one column and the content in the next column.
  2. Next, we need to publish the content. Note: This is more than just “Sharing” the spreadsheet. When you to this, your content will be available to anyone who finds the link to it (which is probably unlikely, but still–don’t use this for anything private or critical).
  3. Once it’s published you need to get the key from it. This can be found in the modal window that pops up when you publish your spreadsheet, it’s one of the query variables in the URL (see image below).

Fetch the Spreadsheet Data

Time to get the data from our spreadsheet using the Google Spreadsheet API. The API is large and complex and you should feel free to explore it and see if it would be useful to you. We’ll use the PHP cURL functions to fetch the data. (Be sure to add in your own API Key and the correct Sheet Tab ID for you needs.)

Revisions

Revision Differences

June 26, 2015 @ 01:05:20Current Revision
Content
As seen here: As seen here: <a href="http:// elikirk.com/using-google- spreadsheets- as-a-cms-with- php/">http:// elikirk.com/ using-google- spreadsheets- as-a-cms-with-php/</a>
<h3>Setup a Published Google Spreadsheet</h3> <h3>Setup a Published Google Spreadsheet</h3>
<ol> <ol>
<li>Create a Google spreadsheet, then fill in the data in your spreadsheet with an identifier in one column and the content in the next column.</li>  <li>Create a Google spreadsheet, then fill in the data in your spreadsheet with an identifier in one column and the content in the next column.</li>
<li>Next, we need to <em>publish</em> the content. Note: This is more than just “Sharing” the spreadsheet. When you to this, your content will be available to anyone who finds the link to it (which is probably unlikely, but still–don’t use this for anything private or critical).</li>  <li>Next, we need to <em>publish</em> the content. Note: This is more than just “Sharing” the spreadsheet. When you to this, your content will be available to anyone who finds the link to it (which is probably unlikely, but still–don’t use this for anything private or critical).</li>
<li>Once it’s published you need to get the <em>key</em> from it. This can be found in the modal window that pops up when you publish your spreadsheet, it’s one of the query variables in the URL (see image below).</li>  <li>Once it’s published you need to get the <em>key</em> from it. This can be found in the modal window that pops up when you publish your spreadsheet, it’s one of the query variables in the URL (see image below).</li>
</ol> </ol>
<h3>Fetch the Spreadsheet Data</h3> <h3>Fetch the Spreadsheet Data</h3>
Time to get the data from our spreadsheet using the Google Spreadsheet API. The API is large and complex and you should feel free to explore it and see if it would be useful to you. Time to get the data from our spreadsheet using the Google Spreadsheet API. The API is large and complex and you should feel free to explore it and see if it would be useful to you.
We’ll use the PHP cURL functions to fetch the data. We’ll use the PHP cURL functions to fetch the data.
(Be sure to add in your own API Key and the correct Sheet Tab ID for you needs.) (Be sure to add in your own API Key and the correct Sheet Tab ID for you needs.)
   [/php]

Note: Spaces may be added to comparison text to allow better line wrapping.

Tags:

No comments yet.

Leave a Reply