20

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!

Rup
  • 33,765
  • 9
  • 83
  • 112
Dimitar
  • 1,830
  • 5
  • 32
  • 52

6 Answers6

12

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.

Ali Afshar
  • 40,967
  • 12
  • 95
  • 109
  • 6
    As of September, Google Docs API has been deprecated in favor of the [Google Drive API](https://developers.google.com/drive/v2/reference/). – amacy Dec 30 '12 at 20:00
  • There is even a newer version: https://developers.google.com/drive/api/v3/about-sdk – Dimitar Jul 02 '19 at 07:22
3

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>
0

If you are intending to write in Python, I found gspread useful.

D W
  • 2,979
  • 4
  • 34
  • 45
Jon Wise
  • 17
  • 1
0

Yes This can be done by including APIs & SDK of Google.. If you are using languages like c# (ASP .net) / Java (JSP /HTML) you need to import/include the reference after installing .dll of Google in your Project.

Note: For using any Google's Product (Email,Map,Calender,...) you need Key Code which can be obtained by logging with some google email and generate API key. you will get encrypted code acts as key to your application / Project to run.

using Google.GData.Client;
using Google.GData.Documents;

namespace MyDocumentsListIntegration
{
  class Program {
    static void Main(string[] args)
    {

      // Application code here

    }
  }
}

Please Refer Following Linkes:

API Reference: Click Here

Detailed Reference: Click Here

Rahul Uttarkar
  • 3,367
  • 3
  • 35
  • 40
0

Yes, this is possible.

You can fetch Google Docs file content, and upload new content with the Google.GData.Client and Google.GData.Documents nuget packages

you can find full information with example with this link here

Vijaykumar
  • 127
  • 1
  • 10
-2

We use Google Docs as the CMS for our website with an application called Feed.Us. Our site is in Php, but Feed.us works with other scripting languages.

Ramon
  • 1