Live data from Hacker News

Show HN: Turn a Google Spreadsheet into an API

sheetsu.com

71–80 of 103 posts

Re: Show HN: Turn a Google Spreadsheet into an API

#71

I've used Google Spreadsheet as an "API" before (manually, not using this wrapper), and it is definitely not made to be used as such. Under heavy load, it slows down or times out, and even under the best circumstances it's not exactly fast. It's great in a pinch. My use-case was a spreadsheet that others in my organization wanted to edit, then we'd pull the data onto a web page and display nicely. It worked, but even…

I also implemented something like this very recently [1] and I would recommend building in caching from the start as I was consistently getting throttled by the Google API even in development (just live reloading the page as I styled it).

Secondly, while the load page and then load the data in as JS approach definitely works, I found that just pushing the data in as HTML on the server side was easier to cache and faster to load.

1 - https://gist.github.com/mbuckbee/0ad3bd150e705c769c50

This was sufficient to handle thousands of requests per hour with a page load time of less than 250ms

Re: Show HN: Turn a Google Spreadsheet into an API

#72
post #66

I've used Google Spreadsheet as an "API" before (manually, not using this wrapper), and it is definitely not made to be used as such. Under heavy load, it slows down or times out, and even under the best circumstances it's not exactly fast. It's great in a pinch. My use-case was a spreadsheet that others in my organization wanted to edit, then we'd pull the data onto a web page and display nicely. It worked, but even…

One thing you can do to make this use-case work better is to combine the spreadsheet as API with a static site generator. I made this very basic plugin for Jekyll: https://github.com/netlify/jekyll-gdrive That'll let you use a Google spreadsheet as a datasource and expose the data to your liquid templates. Combine it with something like https://www.netlify.com that'll run the builds for you and let you trigger builds…

That's a great use case!

Re: Show HN: Turn a Google Spreadsheet into an API

#73

So I threw this into a website to try and load some data into a table, and get: XMLHttpRequest cannot load http://sheetsu.com/apis/d54d6315?sort=Description&order=asc . No 'Access-Control-Allow-Origin' header is present on the requested resource. How do I handle that?

I ran into the same thing. Sheetsu apparently doesn't have CORS ( http://www.html5rocks.com/en/tutorials/cors/ ) enabled so it won't work from client-side JS right now.

Already added to the to do list. Thanks for noticing it.

Re: Show HN: Turn a Google Spreadsheet into an API

#75

Earlier quoted context omitted.

You can POST your data. PUT and DELETE soon.

That'll be great. Is CORS support on the roadmap too?

Yes, it's. - PUT/DELETE - CORS - more sheets in the same workbook - access for only one file in the Google Drive - private APIs

Re: Show HN: Turn a Google Spreadsheet into an API

#76

I've used Google Spreadsheet as an "API" before (manually, not using this wrapper), and it is definitely not made to be used as such. Under heavy load, it slows down or times out, and even under the best circumstances it's not exactly fast. It's great in a pinch. My use-case was a spreadsheet that others in my organization wanted to edit, then we'd pull the data onto a web page and display nicely. It worked, but even…

Admittedly naive question: if the advantage of having Google Sheets store the data is that you can use the Sheets editor when you want to, could something like Sheetsu store the data separately, much faster, for the API, and then just sync any changes between the Google Spreadsheet and their data? So you could still access via Google when needed, but these problems don't matter?

Re: Show HN: Turn a Google Spreadsheet into an API

#77
post #27

Google Spreadsheets is awesome as a quick and dirty CMS. I use it all the time at the newspaper i work for, in combination with Tabletop ( https://github.com/jsoma/tabletop ). Only thing i lack right now is some kind of library that could cache those sheets using Redis for speed.

Flatware was built to be an S3 caching buddy for Tabletop, might prove useful for you: https://github.com/jsoma/flatware
Post reply on HN