Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Google apps script 从Google趋势导入数据的Google脚本_Google Apps Script_Google Sheets_Google Trends - Fatal编程技术网

Google apps script 从Google趋势导入数据的Google脚本

Google apps script 从Google趋势导入数据的Google脚本,google-apps-script,google-sheets,google-trends,Google Apps Script,Google Sheets,Google Trends,只是想知道是否有一个脚本可以将数据从google趋势导入到google工作表中。 基本上,我想每天触发这样的脚本,以了解给定主题的上升趋势,我不确定是否有这样的解决方案可用 否则,是否有执行此任务的解决方案 非常感谢 关于如何使用谷歌应用程序脚本查询谷歌趋势,您可以参考此内容。例如,此函数从电子表格中读取输入并对其进行清理,然后调用queryGoogleTrends执行实际查询并最终显示实际结果: function startQuery() { sheet = SpreadsheetApp.

只是想知道是否有一个脚本可以将数据从google趋势导入到google工作表中。 基本上,我想每天触发这样的脚本,以了解给定主题的上升趋势,我不确定是否有这样的解决方案可用

否则,是否有执行此任务的解决方案

非常感谢

关于如何使用谷歌应用程序脚本查询谷歌趋势,您可以参考此内容。例如,此函数从电子表格中读取输入并对其进行清理,然后调用queryGoogleTrends执行实际查询并最终显示实际结果:

function startQuery() {
  sheet = SpreadsheetApp.getActiveSpreadsheet();

  // start the query
  var result = buildQueryString(sheet.getRangeByName("q").getValue(),
    sheet.getRangeByName("cat").getValue(),
    sheet.getRangeByName("geo").getValue(),
    sheet.getRangeByName("gprop").getValue(),
    sheet.getRangeByName("cmpt").getValue(),
    sheet.getRangeByName("date").getValue()
                    );

  // display the resulting link in a cell
  sheet.getRangeByName("Query_Result").setValue(result).setBackground("yellow");

  var csv_result = generateCsvDownload(sheet.getRangeByName("q").getValue(),
    sheet.getRangeByName("cat").getValue(),
    sheet.getRangeByName("geo").getValue(),
    sheet.getRangeByName("gprop").getValue(),
    sheet.getRangeByName("cmpt").getValue(),
    sheet.getRangeByName("date").getValue()
                    );

sheet.getRangeByName("CSV_Download_Link").setValue(csv_result).setBackground("yellow");

}