如何访问一个JSONP饲料的谷歌应用服务网站版US preadsheet? [英] How do I access a JSONP feed for a Google Apps For Your Domain spreadsheet?

查看:129
本文介绍了如何访问一个JSONP饲料的谷歌应用服务网站版US preadsheet?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能工作了如何通过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,dG1oTHQ5SS1uUzh​​vTnZTSHNzMjdDaVE

当我尝试这对我自己的域名一切的似乎的工作。但是,当我访问我构建如上谷歌的网址给出了错误:

<块引用>在S preadsheet在这个网址也不会被发现。请确保您有正确的网址,并且在S preadsheet车主并没有将其删除。

我认为有一些权限问题或某种我应该使用替代网址,但我无法找到任何文件,否则。

解决方案

这回来是pretty的毛毛,虽然数据。您可以使用YQL来获得更干净的数据:

  SELECT * FROM CSV
其中,url =htt​​ps://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:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆