Skip to content

Instantly share code, notes, and snippets.

@funkenstrahlen
Forked from pamelafox/showspreadsheet.php
Created January 25, 2013 20:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save funkenstrahlen/4637753 to your computer and use it in GitHub Desktop.
Save funkenstrahlen/4637753 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