【问题标题】:Integrate Google Docs into web site for content creation将 Google Docs 集成到网站中以进行内容创建
【发布时间】:2012-04-05 11:48:13
【问题描述】:

我正在建立一个自助出版网站。我想将 Google Docs 集成到我的网站中,并允许每个出版商/作家从我的网站编写她/他的书,然后从我的网站或直接从 google docs 更新内容,并保持两个版本的内容同步。

这可能吗?谢谢!

【问题讨论】:

    标签: google-docs google-docs-api


    【解决方案1】:

    是的,这是可能的。

    您可以获取 Google Docs 文件内容,并使用 Google Documents List API 上传新内容。

    如果您在 Google 文档之外进行编辑,目前您必须自己手动执行同步,在这种情况下,您需要重新上传文件内容。

    【讨论】:

    【解决方案2】:

    不使用 Google API 的新方法。 (www.cloudward.com) - 使用称为 EASE 的语言的 sn-p 可以按程序执行此操作(使用文档和工作表更像是数据库而不是文档)。

    在 EASE 中发布您的 google 文档的声明(您可以将此声明嵌入到您的网页中)如下所示:

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

    每次您的用户更新文档时,它都会自动发布。可以缓存片段,因此它也比使用 Google 发布选项更快(并且文档看起来比 Google 发布时更好)

    这种方法的好处是您可以通过程序控制来解决这个问题。例如,您可以在 Google 工作表中构建已出版书籍的列表:(列:书名、作者、Google 文档名称、已出版(是、否)

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

    这将调用第二页来实际显示这本书:

    <body>
       <!-- bookname is a URL param passed and use as a variable -->
       <# include processed google doc "<#[url.bookname]#>"; #>
    </body>
    

    【讨论】:

      【解决方案3】:

      是的,这可以通过包含 Google 的 API 和 SDK 来完成。 如果您使用 c# (ASP .net) / Java (JSP /HTML) 等语言,则需要在项目中安装 Google 的 .dll 后导入/包含参考。

      注意:要使用任何谷歌的产品(电子邮件、地图、日历……),您需要密钥代码,可以通过使用一些谷歌电子邮件登录并生成 API 密钥来获得。您将获得加密代码作为您的应用程序/项目运行的关键。

      using Google.GData.Client;
      using Google.GData.Documents;
      
      namespace MyDocumentsListIntegration
      {
        class Program {
          static void Main(string[] args)
          {
      
            // Application code here
      
          }
        }
      }
      

      请参考以下链接:

      API 参考:Click Here

      详细参考:Click Here

      【讨论】:

        【解决方案4】:

        是的,这是可能的。

        您可以获取 Google Docs 文件内容,并使用 Google.GData.Client 和 Google.GData.Documents nuget 包上传新内容

        您可以通过此链接here 找到完整的示例信息

        【讨论】:

          【解决方案5】:

          如果您打算用 Python 编写代码,我发现 gspread 很有用。

          【讨论】:

            【解决方案6】:

            我们使用 Google Docs 作为我们网站的 CMS,并带有一个名为 Feed.Us 的应用程序。我们的网站使用 PHP,但 Feed.us 可以使用其他脚本语言。

            【讨论】:

              猜你喜欢
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              • 1970-01-01
              相关资源
              最近更新 更多