API- , , API- Drive . , . , - !
script Google JS- index.html:
<body>
...
<script type="text/javascript" src="https://apis.google.com/js/client.js"></script>
</body>
JS:
var sheets = gapi.client.sheets;
var drive = gapi.client.drive;
sheets.spreadsheets.create({
properties: {
title: 'new-sheet'
}
}).then(function(newSpreadSheet) {
var id = newSpreadSheet.result.spreadsheetId;
drive.revisions.update({
fileId: id,
revisionId: 1
}, {
published: true,
publishAuto: true
}).then(function() {
var iframe = [
'<iframe ',
'src="https://docs.google.com/spreadsheets/d/',
id,
'/pubhtml?widget=true&headers=false&embedded=true"></iframe>'
].join('');
$('#container').html($(iframe));
});
});