by rubbingalcohol · 11y ago · 0 comments
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 eventually we had to set up a secondary server to cache the spreadsheet result because pulling directly from Google in realtime was too unreliable.
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 via webhooks, and you have a Google spreadsheet based publishing engine where the final sites are completely static and live straight on a CDN.
Used it for one site where we used the scripting options of Google spreadsheets to add a "Publish Now" image button to the sheet, so in the end user could edit the the sheet, and then press "Publish" to trigger a build+deploy.
If the users are already used to spredsheets, it can be a really handy little anti CMS :)
[disclaimer: I'm a founder of netlify]
Really great use case
Then we used it as backens for a blog for my University team as we were already using Drive, being each entry a google docs document [2]
[1] https://github.com/franciscop/drive-db [2] http://www.makersupv.com/
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
Here is a sample (from a github employee) that I've used in the past. Source: https://github.com/jlord/hack-spots and live site: jlord.us/hack-spots/#info - not sure how they are caching the spreadsheet, but I've never seen it not perform (not sure about concurrent users or whatever though).
That is, it would be great to keep my data in a google sheet and transform it into a static json file that lives in my app source, but then if I need to work offline, all I can do is edit the json and remember to reflect the changes into the sheet later.
I don't suppose anyone has found a workflow that solves this?