Google Spreadsheets检索JSON供稿 [英] Google Spreadsheets retrieving JSON feed
问题描述
我最近开始使用新Google表格(电子表格),并将网址更改为共享的公开电子表格,但我不确定如何获取电子表格数据的JSON订阅源。
根据此网址的数据: https://developers.google.com/ gdata / samples / spreadsheet_sample
我可以使用在这种格式的URL中找到的关键参数从旧版本电子表格中获取JSON数据: http://spreadsheets.google。 com / feeds / feed / key / worksheet / public / basic?alt = json-in-script& callback = myFunc
然而,一个这样的网址:
https://docs.google.com/ spreadsheets / d / SOME-IDENTIFIER / pubhtml
使用SOME-IDENTIFIER代替密钥不起作用,我不知道如何从新的电子表格中提取JSON供稿...任何人都可以使用此工具?
您应该使用的格式为:
https://spreadsheets.google.com/feeds/cells/
SHEET-IDENTIFIER /
SHEET_INDEX /
public / basic ?alt = json-in-script& callback = JSON_CALLBACK
您可以通过在编辑工作表时查看URL的末尾来找到SHEET_INDEX。
... SHEET-IDENTIFIER / edit#gid = SHEET_INDEX
确保电子表格已发布(不仅是共享的)。
File / Pulish到网络上...
I recently started using the "New Google Sheets" (spreadsheets) and they changed the URL to a shared public spreadsheet and I am unsure how to obtain a JSON feed of the spreadsheet data.
Based on data from this URL: https://developers.google.com/gdata/samples/spreadsheet_sample
I can obtain the JSON data from an older version spreadsheet using the key parameter found in a URL of this format: http://spreadsheets.google.com/feeds/feed/key/worksheet/public/basic?alt=json-in-script&callback=myFunc
However, the new sheets have a URL like this: https://docs.google.com/spreadsheets/d/SOME-IDENTIFIER/pubhtml
Using "SOME-IDENTIFIER" in place of the key does not work, I'm not sure how I can pull the JSON feed from a new spreadsheet... Anyone have any experience with this?
The format you should use is this :
https://spreadsheets.google.com/feeds/cells/ SHEET-IDENTIFIER/ SHEET_INDEX/ public/basic?alt=json-in-script&callback=JSON_CALLBACK
You can find SHEET_INDEX by looking at the end of the URL while editing the sheet.
...SHEET-IDENTIFIER/edit#gid=SHEET_INDEX
Make sure the spreadsheet is published (not only shared).
File/Pulish to the web...
这篇关于Google Spreadsheets检索JSON供稿的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!