soulwire / WTFEngine

An HTML / CSS / JavaScript template for creating WhatTheFuckIsMyMashup.com style web sites
http://blog.soulwire.co.uk
MIT License
686 stars 130 forks source link

Not working with Google Docs any more? Perpetual loading animation #24

Closed Feldherren closed 9 years ago

Feldherren commented 9 years ago

I had a generator that previously used data from a Google Docs spreadsheet, and was working fine then, but now may be failing to load the data - it sits on the loading animation perpetually. I checked out the publishing interface and found it to be changed somewhat, and that my document apparently had a new ID. However, changing the ID in main.js doesn't seem to have fixed the problem and it still shows the perpetual loading animation.

Has anyone gotten this to work with Google Docs spreadsheets lately? If so, how?

tjvonp commented 9 years ago

I found the exact same problem on mine, so you're not alone. I haven't found a solution yet and have switched to using a literal object instead of the spreadsheet.

magnarm commented 9 years ago

I have the same problem. I've tried updating the DOCS_PATH var in line 17 of wtf.js to the new format for publishing csv to web:

var DOCS_PATH = 'https://docs.google.com/spreadsheets/d/{key}/export?gid=0&format=csv';

...but something is still broken :/

soulwire commented 9 years ago

Are you sure the publish settings are correct? It's working fine for me in the demo sheet. What happens when you visit the publish url of the sheet when you're not logged in (i.e in an incognito window?)

magnarm commented 9 years ago

Incognito-window also downloads a (what looks to me) properly formated .csv-file when I enter the url with the new formating. I've tried to revert to the original wtf.js-script in case it was something I messed up when I changed line 17, but that didn't help either. I have no idea what's wrong, everything should be publishing correctly...

( this is the sheet it's trying to pull lines from: https://docs.google.com/spreadsheets/d/1PG_tw7q_WlqGq4p9XEFJahYonSM7qOpt-0FbKGkroXA/export?gid=0&format=csv )

chrisaldrich commented 9 years ago

I'm having the same issue, but noticed when double checking my Google Documents spreadsheet that apparently Google has updated to a new version of their spreadsheet (assuredly along with an updated API). They apparently updated my original spreadsheet to the new version which also resulted in it having a new "key" that apparently no longer works with the older system (see also: https://productforums.google.com/forum/#!msg/docs/7M1ngjjU_TQ/M06tnp1L3DcJ).

My supposition is that the backend that integrates with Google Spreadsheets will need a slight tweak of some sort to get the API into spreadsheets working again. Users may then need to go into their index.html file and update the spreadsheet key they're using. It certainly doesn't appear to be the case that switching back to the old key will make things work.

The spreadsheet URL @magnarm quotes above certainly has the new format in which the "key" follows the https://docs.google.com/spreadsheets/d/ set up.

The near-term fix is to use the json or javascript alternates.

soulwire commented 9 years ago

Hey everyone. Sorry this was open for so long. It should be resolved now and you don't have to use a local JSON file anymore if you don't want to. See #25.

If you drop in the latest wtf.js to your project it should all work again when passing a key to the init method. Other than updating the wtf.js file you shouldn't need to change anything.

The fix was to abandon the csv feed that google blocked and instead use json, which just required some different parsing.

It's not tested with many datasets yet so shout if you spot a problem!