English 中文(简体)
Google gadget/spreadsheet: Grab spreadsheet key for gadget
原标题:

So I m working on a google gadget(really only gadgetizing so I can get a datastore for this) that I want to be embeddable in a google spreadsheet (after this point, I m going to skip the word google - you can just imagine it s there).

I want to use the spreadsheet that I embed the gadget in as a key/value store for the data I enter within the gadget (I think the 2K limit for gadget data won t be enough). It looks like what I ll want to do is use the gadget s feed api to manipulate the spreadsheet s list feed. However, in order to know what the spreadsheet s list feed is, I need to know the key for the spreadsheet (which is in the URL). I don t think I can scrape the key directly from the URL, since the gadget seems to be inserted via iframe.

So I need to know how I can tell a gadget that I m embedding in a spreadsheet the key for that spreadsheet. I suppose I could have the user enter it manually, but I d much rather have my gadget know the key programmatically.

最佳回答

You might want to try using Google Apps Script instead of a gadget. It is aware of the spreadsheet it is embedded on.

http://code.google.com/googleapps/appsscript/

问题回答

You should be able to retrieve a list of spreadsheets by making a GET request to this URL:

https://spreadsheets.google.com/feeds/spreadsheets/private/full

See Google Spreadsheets API for more details: http://code.google.com/apis/spreadsheets/data/3.0/developers_guide_protocol.html#ListingSpreadsheets





相关问题
How to remove a lua table entry by its key?

I have a lua table that I use as a hashmap, ie with string keys : local map = { foo = 1, bar = 2 } I would like to "pop" an element of this table identified by its key. There is a table.remove() ...

Detect if any key is pressed in C# (not A, B, but any)

[EDIT 3] I kind of "solved it" by at using the "strange" version. At least for the most important keys. It is suffient for my case, where I want to check that ALT and ALT+A are not ...

How to get key value

My sample JSON string is as below: {"8776337":{"text":"Test Message","status":"d","created_time":"1244475327","reply_number":"447624800500","completed_time":"1244475373","credits_cost":"0.4"}} "...

Hibernate map collection with constant key

I m trying to map a collection (of type map) using a foreign key and a fixed value as the key/mapping arguments. I have several tables of product types and a language table which holds stuff like ...

Changing the value in a map in Groovy

This is about a very basic program I m writing in Groovy. I have defined a map inside a method: def addItem() { print("Enter the item name: ") def itemName = reader.readLine() print(...

SWT Cross-Platform Enter Detection

I have a global filter (Display.addFilter) in SWT in which I want to detect Enter key. In Windows, pressing Enter generates SWT.CR in keyCode part of KeyListener event. Is this assumption safe for ...

热门标签