Link google sheet to html page - html

I need to link an editable google sheet to my html website so that any change in the sheet will automatically appears in my site.

You can make use of publish option on Google Drive docs files such as Sheets,Slides,Docs and embed them to your Webpages. You can find more information on how to do that here: https://support.google.com/docs/answer/183965
Of course keep in mind that depending on what publishing option you select, you may have to change the access permission of your document/sheets.
Quick Edit:
If you're planning to just embed the sheet, make sure to select the embed option on the same publish to the web section that can be found by going to File > Publish to the web.

Related

Set a custom favicon for different google spreadsheets

I use a lot of different google spreadsheets for day to day tasks.
Sometimes all of them are open at once, and combined with other websites needed it's a lot of open tabs, so the tab header is only the sheets favicon.
I'm looking for a way to add a custom favicon to each spreadsheet using Google Apps Script, to make it easier to identify them when only the icon is visible.
I've found a Chrome extension (https://chrome.google.com/webstore/detail/favicon-changer/ijaabbaphikljkkcbgpbaljfjpflpeoo) which changes the favicon to a specific file I choose, but I need a way to do it natively to each spreadsheet so that it works on any computer.
There's also a different extension which also changes the favicon, but to a random one you can't choose (https://chrome.google.com/webstore/detail/favidenticon-for-google-d/alkonpgilhahbbhihdjnamkmckfajmjo).
Since theres a way to code it in an extension, I'm wondering if there's a way to code it directly in Google Apps Script, assigning a specific file as the favicon.
I've fonund also that there's a setFaviconUrl(iconUrl) method in Class HtmlOutput, but I think it's for Web Apps, I've tried using it but haven't managed to make it work:
https://developers.google.com/apps-script/reference/html/html-output#setfaviconurliconurl
I have the icon files uploaded to a website in case that's needed (this is one of them https://www.botix.com.ar/imagenes-empresa/favicon-pedidos.ico)
I know little about code, so any help would be appreciated!
I am afraid that it is not possible at this moment. The extension you mentioned probably does not work with Google Apps Script and it may be modifying or working with Chrome specific settings or tools.
Since Google Apps Script is not able to work with Chrome related tools or APIs it would not be possible to use Google Apps Script to accomplish this. That is why the only options available are related to Chrome extensions or for web apps as you mentioned.
You can submit this as a feature request for Google Apps Script using this link

How to view Google drive HTML as pdf in google drive

I would like to share pdf in google drive but even with featurs of preventing downloading and printing still can download it image by image that's why i thought to use another way after some research I found pdf2htmlEX so after i convert my pdf to html I upload it in google drive but when i wanted to opended it's appear as html code not as pdf
any help to solve that issue and any idea to share pdf without be downloadble image by image
It sounds like you're trying to secure your PDF and keep people from downloading/screenshotting its contents. Unfortunately, even if you successfully convert the PDF to HTML, people will still be able to view and therefore download/screenshot the contents. It's hard to prevent piracy.
As for the issue regarding your HTML files displaying as HTML in Google Drive, Google Drive doesn't support this. Google Drive no longer renders HTML files as of August 31, 2015:
https://gsuiteupdates.googleblog.com/2015/08/deprecating-web-hosting-support-in.html
If you're looking for a way to secure your PDF, most people will tell you that the simple answer is: you can't. Tools exist that help prevent screen recording and screen printing, but they're expensive and not foolproof. Someone can also just take a picture of their screen. The reality is that if you want to share content with the world through a PDF, you have to accept that it might be shared or stolen.
If you just want some basic protection through Google Drive, Google offers some advice for preventing copying and downloading:
To prevent commenters and viewers from downloading, printing, or
copying your file:
Click Share or Share Add people.
In the bottom right, click Advanced.
Check the box next to "Disable options to download, print,
and copy for commenters and viewers."
Click Save changes.
Click Done.
Source

How to generate an HTML view in App Script from a Google Sheet

I have a client that uses Google forms to take orders and wants to be able to turn the resulting Sheet into a document of Packing Slips. Being a python person I am currently taking her .tsv and making nice HTML printable docs but want to be able to make a plug-in for her so that on any Sheet of this type she can click "Make Packing Slips" and it either opens a new tab with generated HTML (I'm ok using googles templating) or maybe even convert the HTML into a PDF and save it to her drive? Either way I'd rather design the document all in HTML and CSS rather than trying to make a google doc if at all possible. Is the feasible? Any starting points? Thanks!
You need to learn about Google App Script => https://developers.google.com/apps-script/overview
Then these Links should suffice
HTML Service: Create and Serve HTML
Google Container-bound Scripts for Google App Script (Can not post link for this due to low reputation)

Can I use Google Drive's editor interface embed in a website?

I want to use google drive to store the files, but allow the users of my website to be able to edit them transparently, so that they don't have to go to google drive's website.
Is this possible with the current API? Thus far I have only seen how to create an app for them to install in google drive, or doing something like DrEdit (https://developers.google.com/drive/examples/), which parses the files to JSON and uses the ACE editor, which is definitely not what I want.
EDIT:
I believe it is not possible to do this with Google Drive, I've decided to go with Zoho Docs instead.
Yes it's possible. The biggest consideration is how much formatting you want to support. Eg. if it's plain text, it's very simple. If you want to support character or layout formatting, it becomes more complex.
I don't believe its possible to embed the editor (or even embed a preview!) using an iframe, because if you look at how the google docs page loads, it first redirects you to the login page, and that automatically logs you in if you are already logged in, and redirects you back to the docs editor.
This means that the iframe would have to at least pass through the login page, even if the user doesn't need to enter anything. However, google's login page has the x-frame-option header set to SAMEORIGIN (or deny?), and thus, the browser refuses to display it, and thus you can't actually get logged in!
The only way I've found to enable just preview embedding (not editing), is to publish the document first (via the File->publish to web menu item).

opening html from google drive

I have made a page in html5 with css3. It works fine on local (I dont use any server, just doubleclick in the index to open it).
I want to put it in google drive. I have load all the documents needed, but when I try to open the html, I can only see the text (I mean, it is not being executing, I can see just the source code).
Any suggestion?
Not available any more, https://support.google.com/drive/answer/2881970?hl=en
Host web pages with Google Drive
Note: This feature will not be available after August 31, 2016.
I highly recommend https://www.heroku.com/ and https://www.netlify.com/
EDIT: As of August 2016 Google Drive can no longer be used to host static web pages, so this solution no longer works.
Create a new folder in Drive and share it as "Public on the web."
Upload your content files to this folder.
Right click on your folder and click on Details.
Copy Hosting URL and paste it on your browser.(e.g. https://googledrive.com/host/0B716ywBKT84AcHZfMWgtNk5aeXM)
It will launch index.html if it exist in your folder other wise list all files in your folder.
I don't think it is necessary to "host" the content using the way from the accepted answer. It is too complicated for a normal user with limited developing skills.
Google actually has provided hosting feature without using Drive SDK/API, what you need is just few clicks. Check this out:
http://support.google.com/drive/bin/answer.py?hl=en&answer=2881970
It is the same to the answer of user1557669. However, in step 4, the URL is not correct, it is like:
https://drive.google.com/#folders/...
To get the correct host URL. Right click on the html file (you have to finish 1-3 steps first and put the html in the public shared folder), and select "Details" from the context menu. You will find the hosting URL right close to the bottom of the details panel. It should look like:
https://googledrive.com/host/.../abc.html
Then you can share the link to anyone. Happy sharing.
Now you can use
https://sites.google.com
Build internal project hubs, team sites, public-facing websites, and moreā€”all without designer, programmer, or IT help. With the new Google Sites, building websites is easy. Just drag content where you need it.
While drive allows you to edit plain text and HTML files I don't believe they allow the HTML to actually be displayed. I don't think they want people hosting websites from their drive space.
A lot of the solutions offered here do not seem to work anymore. I'm currently on a chromebook and wanted to view an HTML5 banner. This seems impossible now through Google Drive or other apps (as mentioned in previous comments).
The method I ended up using to view the HTML5 was the following:
Open Google Adwords (create a free account if you dont have one)
Click on Ads in the top panel
Click on "+AD" and choose image ad
Choose "upload an ad"
Drag and drop your zip file into the area
Click on Preview
Voila, you will see your HTML5 banners in their full beauty
There may well an easier way, but this way is pretty good too. Hope it helps and worked well for me.
Create a new folder in Drive and share it as "Public on the web."
Upload your HTML, JS & CSS files to this folder.
Open the HTML file & you will see "Preview" button in the toolbar.
Share the URL that looks like www.googledrive.com/host/... from the preview window and anyone can view your web page.
Found method to see your own html file (from here (scroll down to answer from prac): https://productforums.google.com/forum/#!topic/drive/YY_fou2vo0A)
-- use Get Link to get URL with id=... substring
-- put uc instead of open in URL