Thursday, July 7, 2011

The easiest way to parse Google Spreadsheets with PHP

After tinkering with the available publishing options for Google Docs Spreadsheets, I landed on the following.

$jsonData = file_get_contents("http://spreadsheets.google.com/feeds/list/YOUR-SPREADSHEET-ID/1/public/values?alt=json");
var_dump(json_decode($jsonData, true));

This makes the assumption that your spreadsheet content is not private and is OK to "publish as a web page".

3 comments:

  1. Hi there,
    I've been playing around with much the same thing as your Google Sheet powered blog. Are you still working on it at all? If so then please do let me know as I'd be interedted in the progress you've made. You're welcome to have a look at my efforts this far on GitHub:
    Hope to hear from you,
    Cheers,
    Dom

    ReplyDelete
  2. Google forms and google sheet are really helpful for data collection I come to know about one google sheet addons call trigger and send it help us in to collect data from forms and store in the google sheets automatically called Trigger and send. I found it here at: https://chrome.google.com/webstore/detail/trigger-send/lmpdaoninbfpblmajgcodhookngnekek

    ReplyDelete
  3. Thanks for sharing such wonderful information about Jobs in PHP.I read your articles very excellent and the i agree our all points because all is very good information provided this through in the post.Anybody want to build your website.

    White Label Website Builder

    ReplyDelete

Please email files to bla@bla.com