如何访问一个JSONP饲料的谷歌应用服务网站版US preadsheet? [英] How do I access a JSONP feed for a Google Apps For Your Domain spreadsheet?
问题描述
我不能工作了如何通过JSONP访问谷歌小号preadsheet时使得S preadsheet是谷歌企业应用套件的一部分,为您的域帐户。
谷歌提供记录的方式来访问谷歌小号通过JSONP preadsheet一个适合正常gmail.com帐户。简而言之:
- 创建A S preadsheet
- 单击下拉旁边的共享,然后选择发布为Web页
- 复制并粘贴出来的URL,显示键(即之后的比特及键=)
- 到<一个href="https://s$p$padsheets.google.com/feeds/list/0AmHYWnFLY1F-dG1oTHQ5SS1uUzhvTnZTSHNzMjdDaVE/od6/public/values?alt=json-in-script&callback=myCallback" rel="nofollow">https://s$p$padsheets.google.com/feeds/list/0AmHYWnFLY1F-dG1oTHQ5SS1uUzhvTnZTSHNzMjdDaVE/od6/public/values?alt=json-in-script&callback=myCallback与任何键,你砍的网址 出取代0AmHYWnFLY1F,dG1oTHQ5SS1uUzhvTnZTSHNzMjdDaVE
当我尝试这对我自己的域名一切的似乎的工作。但是,当我访问我构建如上谷歌的网址给出了错误:
<块引用>在S preadsheet在这个网址也不会被发现。请确保您有正确的网址,并且在S preadsheet车主并没有将其删除。我认为有一些权限问题或某种我应该使用替代网址,但我无法找到任何文件,否则。
这回来是pretty的毛毛,虽然数据。您可以使用YQL来获得更干净的数据:
SELECT * FROM CSV
其中,url =https://docs.google.com/s$p$padsheet/pub?key=XXXX&output=csv
如果您要命名的键,你可以添加:
和列=富,酒吧,巴兹
试试看 与您的S preadsheet;你应该得到这个(我列名为任务):
cbfunc({
查询:{
伯爵:3,
创造:2013-01-02T21:37:09Z
郎:EN-US
结果:{
行: [
{
任务:偷内裤
},
{
任务: ...
},
{
任务:利润
}
]
}
}
});
I can't work out how to access a google spreadsheet via JSONP when that spreadsheet is part of a Google Apps For Your Domain account.
Google provide a documented way to access google spreadsheet via JSONP that works for normal gmail.com accounts. In short:
- Create a spreadsheet
- Click on the dropdown next to "Share" and select "Publish as a web page"
- Copy and paste out the key from the URL that shows (i.e. the bit after &key=)
- Go to https://spreadsheets.google.com/feeds/list/0AmHYWnFLY1F-dG1oTHQ5SS1uUzhvTnZTSHNzMjdDaVE/od6/public/values?alt=json-in-script&callback=myCallback replacing "0AmHYWnFLY1F-dG1oTHQ5SS1uUzhvTnZTSHNzMjdDaVE" with whatever key you cut out of the url
When I try this on my own domain everything seems to work. But when I visit the URL I have constructed as above google gives the error:
The spreadsheet at this URL could not be found. Make sure that you have the right URL and that the owner of the spreadsheet hasn't deleted it.
I assume there's some permission problem or some kind of alternative url I should be using, but I can't find any documentation otherwise.
The data that comes back is pretty hairy, though. You can use YQL to get cleaner data:
select * from csv
where url="https://docs.google.com/spreadsheet/pub?key=XXXX&output=csv"
If you want to name the keys, you can add:
and columns="foo,bar,baz"
Try it here with your spreadsheet; you should get this (I named the column "task"):
cbfunc({
"query": {
"count": 3,
"created": "2013-01-02T21:37:09Z",
"lang": "en-US",
"results": {
"row": [
{
"task": "Steal underpants"
},
{
"task": "..."
},
{
"task": "Profit"
}
]
}
}
});
这篇关于如何访问一个JSONP饲料的谷歌应用服务网站版US preadsheet?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!