Skip to content

Instantly share code, notes, and snippets.

@mrsinguyen
Forked from pamelafox/showspreadsheet.php
Created January 9, 2011 12:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mrsinguyen/771637 to your computer and use it in GitHub Desktop.
Save mrsinguyen/771637 to your computer and use it in GitHub Desktop.
<?php
// Parsing this spreadsheet: https://spreadsheets.google.com/pub?key=0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc&hl=en&output=html
$url = 'http://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json';
$file= file_get_contents($url);
$json = json_decode($file);
$rows = $json->{'feed'}->{'entry'};
foreach($rows as $row) {
echo '<p>';
$title = $row->{'gsx$title'}->{'$t'};
$author = $row->{'gsx$author'}->{'$t'};
$review = $row->{'gsx$review'}->{'$t'};
echo $title . ' by ' . $author . '<br>' . $review;
echo '</p>';
}
// See this here: http://imagine-it.org/google/spreadsheets/showspreadsheet.php
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment