Integrate Google Docs into web site for content creation

40,514

Solution 1

Yes, this is possible.

You can fetch Google Docs file content, and upload new content with the Google Documents List API.

You will currently have to perform the sync manually yourself if you edit it outside Google Docs, in which case you would reupload the file content.

Solution 2

New Approach to doing this w/o Google APIs. (www.cloudward.com) - A snippet, using a language called EASE can do this prograitacally (using docs and sheets more like a database then docs).

A statement to publish your google doc in EASE (you would embed this statement in your web page) would look like:

 <# include processed google doc "My Book"; #>

Every time your user updates the doc, it is published automatically. Snippets can be cached, so it is also faster then using the Google Publish option (and the docs look better then when Google Published)

What is good about this approach is there is programatic control you could put around this. For example, you could build a list of published books in a Google sheet: (Columns: Book Title, Author, Google Doc Name, Published (yes, no)

<body>
<!-- Open and start a query from a named Google Sheet -->
<# start list for googlesheet "Published Books"; 
    include when published is "yes";
#>

<!-- header of our list -->
<# start header #>
    <table>
        <th>Book</th>
        <th>Author</th>
        <th></th>
    </tr>
<# end header #>

<!-- For each row in the sheet list a line in our table with contents of 
     the sheet and link to a new page to duplay the actual book - passing 
     the book name as a param -->
<# start row #>
    <tr>
        <td><# Book Title #></td>
        <td><# Author #></td>
        <td><a href='<# snippet "Read Book" #>&bookname=<# Google Doc Name #>'>Open Book</a></td>
    </td>
<# end row #>

<!-- Close out our list -->
<# start footer #>
   </table>
<# end footer #>

<# end list #>              
</body> 

This would call a second page to actually display the book:

<body>
   <!-- bookname is a URL param passed and use as a variable -->
   <# include processed google doc "<#[url.bookname]#>"; #>
</body>
Share:
40,514
Dimitar
Author by

Dimitar

I don't have time to write this i have to code...

Updated on March 25, 2020

Comments

  • Dimitar
    Dimitar about 4 years

    I am building a self-publishing web site. I want to integrate Google Docs into my website and allow every publisher/writer to write her/his book from my website and later update the content from either my website or directly from google docs, and to keep the two versions of content in sync.

    Is this possible? Thanks!

  • amacy
    amacy over 11 years
    As of September, Google Docs API has been deprecated in favor of the Google Drive API.
  • Dimitar
    Dimitar almost 5 years
    There is even a newer version: developers.google.com/drive/api/v3/about-sdk