Tak, jest to zdecydowanie możliwe. Korzystałem z interfejsu API Spreadsheet w szerokim zakresie przy użyciu Javascript. Będziesz musiał użyć wersji protokołu API, zgodnie z dokumentacją: https://developers.google.com/google-apps/spreadsheets/
Wymaga to wysłania podpisanych żądań przy użyciu OAuth2 (starsze protokoły auth nie są już wiarygodne.) więc sugeruję użycie biblioteki OAuth2, takiej jak JSO. https://github.com/andreassolberg/jso
Podczas pisania twojego javascript będziesz musiał napisać funkcje, które tworzą łańcuch XML do interfejsu z API protokołu. Parsowanie odpowiedzi jest dość proste. Dodałem fragment kodu, którego użyłem. Możesz również zobaczyć moją odpowiedź na pokrewne pytanie za pomocą JQuery. JQuery .ajax POST to Spreadsheets API?
function appendSpreadsheet(){
//Constructs the XML string to interface with the Spreadsheet API.
//This function adds the value of the param foo to the cell in the first empty row in the column called 'columnTitle'.
//The Spreadsheet API will return an error if there isn't a column with that title.
function constructAtomXML(foo){
var atom = ["<?xml version='1.0' encoding='UTF-8'?>",
'<entry xmlns="http://www.w3.org/2005/Atom" xmlns:gsx="http://schemas.google.com/spreadsheets/2006/extended">',//'--END_OF_PART\r\n',
'<gsx:columnTitle>',foo,'</gsx:columnTitle>',//'--END_OF_PART\r\n',
'</entry>'].join('');
return atom;
};
var params = {
'method': 'POST',
'headers': {
'GData-Version': '3.0',
'Content-Type': 'application/atom+xml'
},
'body': constructAtomXML(foo)
};
var docId //Get this from the spreadsheet URL or from the Google Drive API.
var worksheetId = 'od6'; //The worksheet Id for the first sheet is 'od6' by default.
url = 'https://spreadsheets.google.com/feeds/list/'+docId+'/'+worksheetId+'/private/full';
sendSignedRequest(url, handleSuccess, params); //Use your OAuth2 lib
}
Zbyt szeroki? wtf, jest tak naprawdę tylko jeden nie-hackowy sposób (OAUTH, żądania xml do ich API) –
To zdecydowanie nie jest zbyt szerokie i potrzebuję tej odpowiedzi. –