google-sites

Connecting to the Google Sites API as a “Service Account”

依然范特西╮ 提交于 2019-12-06 12:45:14
I am trying to read a feed from a Google Sites account (Google apps). I don't need my app to require every user to login so i created my ClientID as a "Service Account" in the "Google API console". I have added this Client ID and the scope (https://sites.google.com/feeds/) to the "Mange API client access" page in my google apps control panel. I connect using the code below, all constants are defined in my code with the right values. // api dependencies require_once(GOOGLE_API_PATH); // create client object and set app name $client = new Google_Client(); $client->setApplicationName(GOOGLE_API

Transparent background in Sites Apps Script with HtmlService

允我心安 提交于 2019-12-06 11:20:09
问题 There is a similar question in: Google App Script background transparent with HtmlService with no satisfactory answer. In my situation, I have this simple Apps Script embedded in Google Sites: CODE.GS function doGet() { return HtmlService.createTemplateFromFile('Page') .evaluate().setSandboxMode(HtmlService.SandboxMode.NATIVE); } PAGE.HTML <html> <body style="background-color:transparent"> How do I make it<br/>transparent ? </body> </html> resulting in a page that looks like this: https:/

Where can I find custom themes for Google Sites [closed]

假如想象 提交于 2019-12-06 04:45:52
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm trying to create a custom background theme for a Google Sites site. Awhile back I did some googling and found some sites with a background image and instructions of how to change table dimensions to create a google sites make shift theme. I can no longer find any of these themes anywhere. Does anyone know

How to get the index of the selected item in a list box?

大城市里の小女人 提交于 2019-12-05 19:57:49
I want to get the index of the selected item in a Google Apps Script list box not the selected item itself. All of the examples I've seen so far create a server handler that gets the value of the list box through var list1Value = e.parameter.list1; I want to get the index though so I can index into an array. I tried to use this solution http://productforums.google.com/forum/#!category-topic/apps-script/services/vXa57-9T6E4 but my script complained that indexOf wasn't recognized var currentmonth = months.indexOf(e.parameter.list1); Anyone have a good idea on how to get the index? By the way

Google sites API, IllegalArgumentException(“Trying to set foreign cookie”) after RedirectRequiredException

徘徊边缘 提交于 2019-12-05 16:45:11
I am using the gdata-media-1.0-1.47.1.jar functionality to fetch media data using the com.google.gdata.client.media.MediaService.getMedia(IMediaContent mediaContent) method. For some requests I get a RedirectRequiredException. When I redo the getMedia request, using the url i get from RedirectRequiredException.getRedirectLocation(), I get an IllegalArgumentException("Trying to set foreign cookie") exception. From what I can see, the reason for this is that the domain in the response header for the cookie doesn't match the domain of the redirect location. In com.google.gdata.client.http

OnClick suddenly not working on Google Sites in Chrome

梦想的初衷 提交于 2019-12-05 04:51:31
I wrote a page that used buttons with onclick to call a function as part of a set of practice problems and answers for my students. It has worked since July with no issues through Friday, September 5 at least. Today the buttons fail to function at all in Chrome, and I can't figure out why for the life of me. They do continue to function properly in IE. I've posted the simplest code I could write that won't work below. It's awfully simple, and honestly I think it's fine. It seems to work if I paste the entire thing into JSFiddle's HTML box, but if I try to separate the script it doesn't do

Resizing image in Google Apps Script

夙愿已清 提交于 2019-12-04 23:38:55
问题 I have an image and I want to resize this. App Script code: var fileId = 'idImage'; var img = DriveApp.getFileById(fileId).getBlob().; newFile.getBody().insertImage(0, img); Object Blob can't resize so how can I resize my image? Regards 回答1: Just as an FYI, you don't need to call getBlob().. anything that has a getBlob() can be passed in directly wherever a Blob is needed. 回答2: I found a solution : var fileId = 'ImageID'; var img = DriveApp.getFileById(fileId).getBlob(); var imgDoc = newFile

“Access Not Configured. Please use Google Developers Console to activate the API for your project.”

两盒软妹~` 提交于 2019-12-04 17:10:14
问题 I have a google site with a form.I have added a script to the form's spreadsheet and added a "on form submit" trigger. I am trying to create an empty circle. Here is the script. function createCircle(e) { try{ var email = Session.getActiveUser().getEmail(); var sh = SpreadsheetApp.getActiveSheet(); var circle = PlusDomains.newCircle(); circle.displayName = e.values[1]; var userId = 'me'; circle = PlusDomains.Circles.insert(circle, userId); MailApp.sendEmail(email,'event created' , "Circle

Transparent background in Sites Apps Script with HtmlService

隐身守侯 提交于 2019-12-04 15:33:32
There is a similar question in: Google App Script background transparent with HtmlService with no satisfactory answer. In my situation, I have this simple Apps Script embedded in Google Sites: CODE.GS function doGet() { return HtmlService.createTemplateFromFile('Page') .evaluate().setSandboxMode(HtmlService.SandboxMode.NATIVE); } PAGE.HTML <html> <body style="background-color:transparent"> How do I make it<br/>transparent ? </body> </html> resulting in a page that looks like this: https://sites.google.com/site/seanpj01/backtest Even if the trick of setting <body style="background-color

Google Visualization not working with appscript html service

假如想象 提交于 2019-12-04 12:57:36
问题 I want to use appscript htmlservice along with appscript, The html service seems to work but the visualization do not work. Here is the code for reference. Code.GS : // Script-as-app template. function doGet() { return HtmlService.createHtmlOutputFromFile('html_visualization'); } html_visualization.html <html> <head> <script type="text/javascript" src="https://www.google.com/jsapi"></script> <script type="text/javascript"> google.load('visualization', '1.0', {'packages':['corechart']});