TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Use a Google Spreadsheet as your JSON backend

219 pointsby bitsweetover 11 years ago

28 comments

nirvanatikkuover 11 years ago
..FWIW, for those of you who haven&#x27;t been enlightened with the power that Google Apps Script[1] offers yet, be sure to check it out: <a href="http://script.google.com" rel="nofollow">http:&#x2F;&#x2F;script.google.com</a>. Layered on top of Spreadsheets, this pair takes prototyping to a whole new level.<p>[1] <a href="https://developers.google.com/apps-script/" rel="nofollow">https:&#x2F;&#x2F;developers.google.com&#x2F;apps-script&#x2F;</a>
评论 #6672022 未加载
评论 #6671947 未加载
评论 #6672057 未加载
评论 #6674397 未加载
surrealover 11 years ago
Good for prototyping, thanks. I&#x27;d be wary of using this in a live system though: relying on Google&#x27;s public APIs&#x2F;services is risky enough (Checkout is one example, Reader, etc) let alone an undocumented feature like this which could change&#x2F;disappear suddenly.<p>Edit: it has been pointed out that the criticism of their documented&#x2F;public APIs may be unjustified. The issue here is that this particular feature is undocumented
评论 #6672768 未加载
评论 #6674867 未加载
评论 #6671996 未加载
评论 #6672065 未加载
donohoeover 11 years ago
We use Google Spreadsheets for our sites Version history page. Makes it easy to maintain an up-to-date list of all the changes we push out.<p>Its pretty easy to setup your own:<p><a href="http://open.qz.com/post/52146389669/build-your-own-versions-page-on-google-spreadsheets" rel="nofollow">http:&#x2F;&#x2F;open.qz.com&#x2F;post&#x2F;52146389669&#x2F;build-your-own-versions-...</a><p><a href="https://github.com/Quartz/tumblr/tree/master/open/examples/google-drive-jsonp" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Quartz&#x2F;tumblr&#x2F;tree&#x2F;master&#x2F;open&#x2F;examples&#x2F;g...</a>
tgassonover 11 years ago
This is great for prototypes but there&#x27;s an edge case that breaks it&#x27;s usefulness in live sites.<p>Sometimes google will make already logged in users reauthenticate. It will redirect to the authentication page and you&#x27;ll get a bunch of HTML rather than json returned, and the user won&#x27;t know why it&#x27;s not working.
评论 #6671986 未加载
minikomiover 11 years ago
For what it&#x27;s worth, sheets also has publish as CSV which is super useful for, say, building d3 graphs (d3 consumes csv like a champ).<p>I&#x27;m using it a lot lately as I have to create static sites with a bunch of different translations. I have the translators edit a set template, which is aggregated into a single sheet. Then, a (racket.. could be python or anything) script reads from the published csv and outputs all the translated pages. Super useful.
评论 #6673509 未加载
espeedover 11 years ago
We use a Google Spreadsheet as the DB for the TinkerPop Book preview sign up form (<a href="http://www.tinkerpopbook.com" rel="nofollow">http:&#x2F;&#x2F;www.tinkerpopbook.com</a>), however, we used the old-style Google Docs Form (<a href="https://spreadsheets.google.com/formResponse" rel="nofollow">https:&#x2F;&#x2F;spreadsheets.google.com&#x2F;formResponse</a>), which allows anyone to add an entry to the spreadsheet while protecting against anyone from edititing existing entries.<p>This postContactToGoogle function gets around the cross-domain issue: <a href="http://www.tinkerpopbook.com/js/script.js" rel="nofollow">http:&#x2F;&#x2F;www.tinkerpopbook.com&#x2F;js&#x2F;script.js</a> -- props to the base22 team for the tip (<a href="https://wiki.base22.com/pages/viewpage.action?pageId=72942000" rel="nofollow">https:&#x2F;&#x2F;wiki.base22.com&#x2F;pages&#x2F;viewpage.action?pageId=7294200...</a>).<p>Unfortunately the option for creating the old-style Google Form is not directly available since Google switched everything over to Google Drive (if anyone knows how to access it please let me know) so I cloned&#x2F;copied an existing old-style form for future use.
justincormackover 11 years ago
Yes I have done this. Google make it particularly difficult to get the URL of the spreadsheet. And that od6? Thats if you have multiple tabs, they have random identifiers. Its almost impossible to work out what they will be. Its like they are on the web but not of the web.<p>But it is an easy interface for unskilled users to add data to say a graph on a website, have done that for clients and they have been very happy.
评论 #6672800 未加载
yahelcover 11 years ago
Tabletop is a great JS library for dealing with this:<p><a href="https://github.com/jsoma/tabletop" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;jsoma&#x2F;tabletop</a>
评论 #6672095 未加载
评论 #6674838 未加载
评论 #6671757 未加载
评论 #6671774 未加载
noivover 11 years ago
Hmm, I would think thrice, before I go his path again. Thought it was a clever idea to use the mixture of easy to maintain spreadsheets, the cron service and JSON to feed huge satellite images into a tiling service (zoom.it) and let Google autonomously update and serve the list of daily mosaics as JSON.<p>I got used to daily time out messages, but waiting 1 min for a (cached!) 10 kb JSON list is far too much. However, organizing and correcting data using an online spreadsheet saves a lot of time and is kinda fun.
评论 #6673921 未加载
nicolscover 11 years ago
We&#x27;ve been using Google Spreadsheets as part of our &quot;CMS&quot; in our latest website redesign.<p>We&#x27;re relying on schema.org normalization: no more item.gsx$stuff everywhere + switching or mixing data providers is effortless.<p><a href="http://joshfire-tech.tumblr.com/post/65032069418/using-third-party-service-providers-as-cms" rel="nofollow">http:&#x2F;&#x2F;joshfire-tech.tumblr.com&#x2F;post&#x2F;65032069418&#x2F;using-third...</a>
评论 #6671811 未加载
tburchover 11 years ago
This is a great way of putting a UI on top of JSON! I created <a href="http://jsonblob.com/" rel="nofollow">http:&#x2F;&#x2F;jsonblob.com&#x2F;</a> to accomplish the same thing, but a spreadsheet is much more familiar than a JSON editor.
评论 #6671985 未加载
stu_kover 11 years ago
I wrote a small library a while ago to use Google spreadsheets like this: <a href="https://github.com/Stuk/gooss" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Stuk&#x2F;gooss</a> (although it appears some better, more maintained ones have appeared in the mean time).<p>You can see it working at <a href="http://stuartk.com/bundle/" rel="nofollow">http:&#x2F;&#x2F;stuartk.com&#x2F;bundle&#x2F;</a> (data from <a href="https://docs.google.com/spreadsheet/ccc?key=0Ar35F5WUAjXedDY4R0VTS05UcWhaM081eklIclN0VFE" rel="nofollow">https:&#x2F;&#x2F;docs.google.com&#x2F;spreadsheet&#x2F;ccc?key=0Ar35F5WUAjXedDY...</a> )<p>This is combined with with Google forms to allow people to submit new data, and the publish to RSS feature, although the content of the RSS feed isn&#x27;t very pretty.
exrationeover 11 years ago
I&#x27;ve implemented a Node.js app that used Google Spreadsheets as the backend for a client. They found it more cost effective for non-technical admins to deal with than building their own, so more power to them.<p>I wrote up some notes from the experience, as Google Spreadsheets is full of quirks and some of the APIs and other means of access are very easy to break - it is very easy to create a spreadsheet that will return broken JSON, for example, in some modes, and then cannot be fixed (ever) to return unbroken JSON.<p><a href="https://www.exratione.com/2013/04/some-notes-on-csv-parsing-and-google-spreadsheets-in-nodejs/" rel="nofollow">https:&#x2F;&#x2F;www.exratione.com&#x2F;2013&#x2F;04&#x2F;some-notes-on-csv-parsing-...</a>
tsielingover 11 years ago
We used this strategy on a small vendor database for a local nonprofit street newspaper when we built a vendor locater web app for them. The non-technical staff can update vendor names, availability, photos (by URL) and locations, which we then pull from to populate a map-driven search. It worked really well and saved hours of work building a custom CMS.<p>The app is at <a href="http://find.megaphonemagazine.com" rel="nofollow">http:&#x2F;&#x2F;find.megaphonemagazine.com</a> (best viewed on a smartphone) and the code is open source at <a href="https://github.com/denimandsteel/megaphone" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;denimandsteel&#x2F;megaphone</a>. Case study is at <a href="http://denimandsteel.com/work/megaphone-finder/" rel="nofollow">http:&#x2F;&#x2F;denimandsteel.com&#x2F;work&#x2F;megaphone-finder&#x2F;</a>
lennelover 11 years ago
I played with this in 2008, works nicely. I remember running into a 42k row limit with a single spreadsheet.
staredover 11 years ago
There is a wonderful example - a crowdsourced collection of d3.js visualizations: <a href="http://christopheviau.com/d3list/gallery.html" rel="nofollow">http:&#x2F;&#x2F;christopheviau.com&#x2F;d3list&#x2F;gallery.html</a> (all code GitHub, all data - a Google Spreadsheet everyone can contribute to).<p>GitHub: <a href="https://github.com/biovisualize/d3visualization" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;biovisualize&#x2F;d3visualization</a><p>Spreadsheet: <a href="https://docs.google.com/spreadsheet/ccc?key=0AqMEGBUNwXeHdHpQNlVuY29SUE5BSXVtS3JueGlNYVE#gid=0" rel="nofollow">https:&#x2F;&#x2F;docs.google.com&#x2F;spreadsheet&#x2F;ccc?key=0AqMEGBUNwXeHdHp...</a>
FromStoneageover 11 years ago
you&#x27;re stealing my idea ! <a href="http://www.nextofwindows.com/how-to-use-google-doc-spreadsheet-serve-json-from-excel-spreadsheet/" rel="nofollow">http:&#x2F;&#x2F;www.nextofwindows.com&#x2F;how-to-use-google-doc-spreadshe...</a>
评论 #6673726 未加载
walshemjover 11 years ago
Sorry if you cant put together a basic back end for your app in mysql, Berkly DB or if you need to use json mongodb - you should stick to the day job at MacDonalds
评论 #6675823 未加载
dota168over 11 years ago
Logical Increments PC Parts Guide<p><a href="http://www.logicalincrements.com/" rel="nofollow">http:&#x2F;&#x2F;www.logicalincrements.com&#x2F;</a><p>has been doing this to present their data.
theg2over 11 years ago
I ended up building this into our data warehouse system as managing my own UI for a KVP data store became a nightmare with rapidly changing requirements. It&#x27;s in PHP but allows reporters and producers to enter their data in a spreadsheet and then allows us to publish it out to JSON for use in D3 or leaflet.<p>It&#x27;s greatly sped up our process for visualization.
Q_the_Noviceover 11 years ago
I have once used Google Spreadsheets as a database for a bookmarking app: <a href="https://github.com/qawemlilo/Bookmarks" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;qawemlilo&#x2F;Bookmarks</a>. What I did different was that I published my spreadsheet as a CSV doc and then used YQL to convert is to JSONP.
mqzaidiover 11 years ago
You can also use the Google query language to do more with the API - see <a href="http://qzaidi.github.io/2013/10/05/quranjs/" rel="nofollow">http:&#x2F;&#x2F;qzaidi.github.io&#x2F;2013&#x2F;10&#x2F;05&#x2F;quranjs&#x2F;</a>
fatihacetover 11 years ago
It&#x27;s nice tip. However IMO, it would be better to use services like Firebase.
评论 #6673582 未加载
chrisweeklyover 11 years ago
Clever hack, for prototypes.
el_shayanover 11 years ago
I learned it the hard way: if an API is not official it is likely to break.
warrior10111over 11 years ago
cool, I made this bookmarklet to convert spreadsheets to JSON directly from Google Drive:<p>javascript:(function(){var key=&#x2F;key=[a-zA-Z0-9]+&#x2F;.exec(window.location.search)[1];var url=&quot;<a href="https://spreadsheets.google.com/feeds/list/&quot;+key+&quot;/od6/public/values?alt=json&quot;;window.location=url;})();" rel="nofollow">https:&#x2F;&#x2F;spreadsheets.google.com&#x2F;feeds&#x2F;list&#x2F;&quot;+key+&quot;&#x2F;od6&#x2F;publi...</a>
genericacctover 11 years ago
In this thread: people who don&#x27;t know they should be using ethercalc =)
评论 #6676049 未加载
collywover 11 years ago
Wonderful. &quot;Excel as a database&quot; more or less.