google-docs-api

Java - Google API - Publish a document

跟風遠走 提交于 2019-12-01 11:20:10
问题 I have a problem uploading information using the Google Document API. The task is to upload a document, then publish it right after the upload. The first part I have solved, get a DocsService client, authenticate myself with client.setUserCredentials(userName, password) method, and then upload the content with client.insert(URL, newDocument) . At this point the document appears in my Google folder. My problem is I can't figure out how too publish it. I tried to emulate the POST method (what

Google Apps Script; Docs; convert selected element to HTML

六月ゝ 毕业季﹏ 提交于 2019-12-01 11:11:24
I am just starting with Google Apps Script and following the Add-on quickstart https://developers.google.com/apps-script/quickstart/docs In the quickstart you can create a simple add-on to get a selection from a document and translate it with the LanguageApp service. The example gets the underlying text using this: function getSelectedText() { var selection = DocumentApp.getActiveDocument().getSelection(); if (selection) { var text = []; var elements = selection.getSelectedElements(); for (var i = 0; i < elements.length; i++) { if (elements[i].isPartial()) { var element = elements[i]

Google App script extracting data from website

随声附和 提交于 2019-12-01 09:15:21
问题 So I am writing a script which look at review done on google+ pages and updates a google spreadsheet. I have found out that the line in the html which holds this value is <span class="A7a">103</span> I just need to make it possible for me to extract from the page with just knowing the URL and that html code. 回答1: Use var response = UrlFetchApp.fetch("http://www.website.com/"); To fetch the html of the page. Then use something like var cut = response.substring( str.indexOf( "<span class="A7a">

Script to change owner of a document in Google Docs

心已入冬 提交于 2019-12-01 01:41:37
New here to StackOverflow and Google Apps Script. I appreciate any assistance/guidance. The Task: I'm trying to write a Google Apps Script that will transfer ownership of all files in a specified folder to one owner. I am a super admin for a Google Apps Premier Edition account. However, I will be neither the original owner or the new owner, and the new owners cannot be super admins (and thus run scripts) for security reasons. Both the original and new owners are on the same domain. I found the following code , which I've used and tweaked for my purposes, but I'm getting "Request failed for

OAuth - Invalid token: Request token used when not allowed

自闭症网瘾萝莉.ら 提交于 2019-11-30 21:38:59
I'm trying to access Google's Documents List API 3.0 with OAuth 2.0 but I'm having some troubles with a 401 Error. After user have accepted, my code is the following: GoogleOAuthParameters oauthParameters = new GoogleOAuthParameters(); oauthParameters.setOAuthConsumerKey(CLIENT_ID); oauthParameters.setOAuthConsumerSecret(CLIENT_SECRET); oauthParameters.setOAuthToken(token); oauthParameters.setOAuthTokenSecret(tokenSecret); oauthParameters.setScope("https://docs.google.com/feeds/"); service = new DocsService("myapp"); service.setOAuthCredentials(oauthParameters, new OAuthHmacSha1Signer());

Android - Google Drive HTTP Request

谁说胖子不能爱 提交于 2019-11-30 21:12:48
I am trying to write an application which can upload files to Google Drive. I have chosen to interact with this service via raw http requests as I haven't found any useful examples of the API on Android and as it seems more lightweight then the provided libraries. I've used https://developers.google.com/oauthplayground/ to get the various calls and responses and am trying to write a simple request to return the list of files. The request sent via the tool is: POST /drive/v2/files HTTP/1.1 Host: www.googleapis.com Content-length: 0 Content-type: application/json Authorization: OAuth *token goes

How to programmatically create a Google Docs spreadsheet WITH CONTENT?

允我心安 提交于 2019-11-30 19:16:22
I have found multiple StackOverflow questions dealing with how to create or edit Google Doc spreadsheets using the Google Spreadsheets API , or older API's. However, this Spreadsheets API seems to be part of the "gdata" library, which to my understanding is deprecated. Newer StackOverflow answers show how to create an empty spreadsheet using the Drive API, which seems more current. However, from looking at the documentation and examples for that API, it seems to only let you create new EMPTY files with the spreadsheet MIME type. I have not found any functionality for creating a spreadsheet

How to publish Google Docs in .NET?

南笙酒味 提交于 2019-11-30 17:57:53
问题 I'm using the google-gdata .NET library for integrating with Google Docs. It's working out pretty well, but I can't figure out how to use it to publish my documents for view-only link-based web access. The basic idea behind this is to be able to upload a document to Google Docs, and be able to view that document in a web environment (outside of Google) without having to log in using a Google credential. As far as I can tell, the best way to do that would be publishing it via a secret link, as

Android - Google Drive HTTP Request

笑着哭i 提交于 2019-11-30 17:17:09
问题 I am trying to write an application which can upload files to Google Drive. I have chosen to interact with this service via raw http requests as I haven't found any useful examples of the API on Android and as it seems more lightweight then the provided libraries. I've used https://developers.google.com/oauthplayground/ to get the various calls and responses and am trying to write a simple request to return the list of files. The request sent via the tool is: POST /drive/v2/files HTTP/1.1

Insert image into a specified location

前提是你 提交于 2019-11-30 16:23:49
I have a Google Apps script which replaces placeholders in a copy of a template document with some text by calling body.replaceText('TextA', 'TextB');. Now I want to extend it to contain images. Does anybody have idea how to do this? Thank you, Andrey EDIT: Just to make it clear what my script does. I have a Google form created in a spreadsheet. I've created a script which runs upon form submission, traverses a sheet corresponding to the form, find unprocessed rows, takes values from corresponding cells and put them into a copy of a Google document. Some fields in the Google form are multi