This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Includes functions for exporting active sheet or all sheets as JSON object (also Python object syntax compatible). | |
// Tweak the makePrettyJSON_ function to customize what kind of JSON to export. | |
var FORMAT_ONELINE = 'One-line'; | |
var FORMAT_MULTILINE = 'Multi-line'; | |
var FORMAT_PRETTY = 'Pretty'; | |
var LANGUAGE_JS = 'JavaScript'; | |
var LANGUAGE_PYTHON = 'Python'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// URL to spreadsheet. Make sure to append ?alt=json to return contents in JSON format | |
$url = 'https://spreadsheets.google.com/feeds/list/0Ah0xU81penP1dFNLWk5YMW41dkcwa1JNQXk3YUJoOXc/od6/public/values?alt=json'; | |
$file= file_get_contents($url); | |
$json = json_decode($file); | |
echo '<pre>'.print_r($json, 1).'</pre>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$spreadsheetID = '1pO7BBOkhWL2TcBPYkDTlWZ0Gbw4mAUSadK_8NOn0Ij8'; | |
$urlPath = 'http://spreadsheets.google.com/feeds/list/' . $spreadsheetID . '/od6/public/values?alt=json'; | |
$file = file_get_contents($urlPath); | |
$json = json_decode($file); | |
$rows = $json->{'feed'}->{'entry'}; | |
?> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$key = '0AsfENoKj1ir7dE8yR6U0aUtpdTVNM20wRlNJOhZaclG'; | |
$json_string = file_get_contents("https://spreadsheets.google.com/feeds/list/$key/od6/public/values?alt=json"); | |
$obj = json_decode($json_string); | |
foreach ($obj->{'feed'}->{'entry'} as $entry) | |
{ | |
echo "<p>"; | |
$num_column = 0; | |
$answer = explode(', ', $entry->{'content'}->{'$t'}); | |
foreach ($answer as $a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function get_google_spreadsheet($key) { | |
$url = "https://spreadsheets.google.com/feeds/list/{$key}/od6/public/values"; | |
$google_sheet = file_get_contents($url); | |
$xml = simplexml_load_string($google_sheet); | |
$data = array(); | |
foreach($xml->entry as $entry) { | |
$row = array(); | |
// The fields are in the gsx: namespace, so we need to specify that to be able to access them through SimpleXML. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Section 5: edit a row | |
// You'll need to get the etag and row ID, and send a PUT request to the edit URL | |
$rowid = 'cre1l'; // got this and the etag from the table data output from section 3 | |
$etag = 'NQ8VCRBLVCt7ImA.'; | |
$url = "https://spreadsheets.google.com/feeds/list/$fileId/od6/private/full/$rowid"; | |
$method = 'PUT'; | |
$headers = ["Authorization" => "Bearer $accessToken", 'Content-Type' => 'application/atom+xml', 'GData-Version' => '3.0']; | |
$postBody = "<entry xmlns=\"http://www.w3.org/2005/Atom\" xmlns:gsx=\"http://schemas.google.com/spreadsheets/2006/extended\" xmlns:gd=\"http://schemas.google.com/g/2005\" gd:etag='"$etag"'><id>https://spreadsheets.google.com/feeds/list/$fileid/od6/$rowid</id><gsx:gear>phones</gsx:gear><gsx:quantity>6</gsx:quantity></entry>"; | |
$req = new Google_Http_Request($url, $method, $headers, $postBody); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div :class="topContainerClasses"> | |
<div | |
v-click-outside="clickedOutside" | |
:tabindex="dropdownOptions && dropdownOptions.tabindex ? dropdownOptions.tabindex : 0" | |
:class="['vti__dropdown', { open: open }]" | |
@keydown="keyboardNav" | |
@click="toggleDropdown" | |
@keydown.esc="reset" | |
> |