Closed aprasad1993 closed 9 years ago
I think the issue is because google does not allow to fetch a list of worksheets as JSON output. Oddly though, it only allows JSON output if you fetch it using public visibility. Changing that fixes the error.
I'm getting the same error, I've tried changing the settings with no luck.
Weird thing is, it works for some spreadsheets and not others with the same sharing prefs.
@aprasad1993 did you ever figure this out?
I think this is most likely because of the update to Google sheets.
It works fine for the old sheets (with the old URL structure): https://docs.google.com/spreadsheet/ccc?key=********************************************#gid=*
And doesn't work for new Google sheets (with the URL structure): https://docs.google.com/spreadsheets/d/********************************************/edit#gid=0
So, if you make a copy from an old Spreadsheet, this node module should work with the copy (which will also be an old google spreadsheet).
This worked for me, let me know if it does work for you.
Dug a little deeper. Currently the endpoint at http://spreadsheets.google.com/feeds/worksheets/key/private/full' returns null when you pass the alt=json parameter.
If you leave it off you get an xml response.
Tooling around with xml2json right now, but it seems to produce a slightly different object than google's json parser does.
If you use public, it returns for json responses as well. I still haven't been able to understand why that works though
Aditya
On 21-May-2014, at 20:39, Dan Nawara notifications@github.com wrote:
Dug a little deeper. Currently the endpoint at http://spreadsheets.google.com/feeds/worksheets/key/private/full' returns null when you pass the alt=json parameter.
If you leave it off you get an xml response.
Tooling around with xml2json right now, but it seems to produce a slightly different object than google's json parser does.
— Reply to this email directly or view it on GitHub.
Doesn't work!! I'm having this error simple running "read example" from main github page. I've tried sharing the spreadsheet as "Public" and as "Anyone who has the link" without any luck. Ooooh!!!
I was able to resolve the issue by using worksheetId: 'od6' as opposed to worksheetName: 'Sheet1'
No.
/home/q2dg/node_modules/edit-google-spreadsheet/lib/index.js:415
if(!result.feed) {
^
TypeError: Cannot read property 'feed' of undefined
at /home/q2dg/node_modules/edit-google-spreadsheet/lib/index.js:415:15
at Request._callback (/home/q2dg/node_modules/edit-google-spreadsheet/lib/index.js:111:16)
at Request.self.callback (/home/q2dg/node_modules/edit-google-spreadsheet/node_modules/request/index.js:148:22)
at Request.EventEmitter.emit (events.js:110:17)
at Request.
I think you are talking about old format of spreadsheets (which have the "ccc=..." in the url).
This is a major problem for me. This bug equates to incompatibility of node-edit-google-spreadhseets with all new Google Spreadsheets, since any spreadsheet created after March 2014 will use the new version https://support.google.com/docs/answer/3544847?hl=en&ref_topic=20322
Also note that Google has warned that all existing spreadsheets will eventually be converted over to the new version.
I also made some progress using xml2json to convert the XML response, but some characters, including parenthesis are not decoded properly. I did come up with fixes for other conversion issues, including namespaces and some issues with particular uses of collections/arrays.
Hey guys, sorry I've been a bit slack with this project - super busy at work. Is anyone interested in sending a pull request :) ?
same as @kmackinnon, replacing the worksheetName
parameter by worksheetId: '0'
did the trick!
No!!!!
/home/q2dg/node_modules/edit-google-spreadsheet/lib/index.js:415
if(!result.feed) {
^
TypeError: Cannot read property 'feed' of undefined
at /home/q2dg/node_modules/edit-google-spreadsheet/lib/index.js:415:15
at Request._callback (/home/q2dg/node_modules/edit-google-spreadsheet/lib/index.js:111:16)
at Request.self.callback (/home/q2dg/node_modules/edit-google-spreadsheet/node_modules/request/index.js:148:22)
at Request.EventEmitter.emit (events.js:110:17)
at Request.
The PR from ssimono fixed my issue. Any chance of merging it into the official repo?
For the record, the PR was merged, this issue can be closed.
should have no more JSON issues now we're using xml2json
to parse all responses
I am getting this error after google login and spreadsheet searching has been done. Please help me out.
app.get('/lead', function(req, res){
Spreadsheet.load({ debug: true, spreadsheetId: '****', worksheetName: 'Sheet1', // Choose from 1 of the 3 authentication methods: // 1. Username and Password username: 'aprasad1993@gmail.com', password: '*******', // OR 2. OAuth // oauth : { // email: 'my-name@google.email.com', // keyFile: 'my-private-key.pem' // }, // // OR 3. Token // accessToken : { // type: 'Bearer', // token: 'my-generated-token' // } }, function sheetReady(err, spreadsheet) { if(err) throw err;
}); });