【问题标题】:Google App Script to export chat history to spreadsheet谷歌应用脚​​本将聊天记录导出到电子表格
【发布时间】:2013-09-26 12:47:21
【问题描述】:

我想编写一个备份脚本来将我的聊天记录传输到 Google 电子表格。

【问题讨论】:

    标签: google-apps-script google-sheets


    【解决方案1】:

    这可能是您之前尝试过的路线,尽管您没有提供大量信息,因此很难判断。

    在GmailApp类中有一个返回聊天线程的方法(https://developers.google.com/apps-script/reference/gmail/gmail-app#getChatThreads()),你可以指定返回的最大线程数和起始索引位置。

    function chatThreadsExample() {
    
      // get first 10 chat threads
      var threads = GmailApp.getChatThreads(0,10);
    
      //get first thread messages
      var messages = threads[0].getMessages();
    
      //get first thread first message contents
      Logger.log(messages[0].getBody());
    
    }
    

    正如您所见,将每个聊天线程及其内容归档到电子表格中绝对是可能的,但相当密集(取决于有多少聊天以及每个聊天的时长)。

    【讨论】:

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