简体   繁体   English

将数据从多个 Chrome 扩展程序提供给单个 Google 电子表格的最佳无服务器方式

[英]Best SERVERLESS way to feed data from multiple Chrome extensions to a single Google Spreadsheet

I have a Chrome browser plugin which performs like a social media posts bookmarks collector (a click on a post captures it's author username, text, date, permalink and the plugin user who owns it).我有一个 Chrome 浏览器插件,它的功能类似于社交媒体帖子书签收集器(点击帖子会捕获它的作者用户名、文本、日期、永久链接和拥有它的插件用户)。 I'm looking for the most efficient, safest and SERVERLESS way to have [potentially] thousands of plugin end-users update, for each individual click on a post, a line in a Google spreadsheet.我正在寻找最有效、最安全和SERVERLESS 的方式来让 [潜在] 成千上万的插件最终用户更新,每次点击一篇文章,Google 电子表格中的一行。

With my limited knowledge I narrowed the options to webhooks:以我有限的知识,我缩小了 webhooks 的选择范围:

  1. Create a Google Apps simple webhook app that will listen to plugin packets.创建一个 Google Apps 简单的 webhook 应用程序,它将侦听插件数据包。
  2. Have the end-user plugins send each social-media post click data in JSON to the webhook.让最终用户插件以 JSON 格式将每个社交媒体点击后数据发送到 webhook。
  3. Have the webhook Google App publish an RSS feed with all the data collected让网络钩子 Google App 发布包含所有收集数据的 RSS 提要
  4. Have the Google Spreadsheet regularly check for new RSS entries and update a new line for each.让 Google 电子表格定期检查新的 RSS 条目并为每个条目更新一个新行。

What i'm not sure of is 1) whether a simple webhook can be created using Google Apps?我不确定的是 1) 是否可以使用 Google Apps 创建一个简单的 webhook? 2) can this method be secure enough to prevent non-plugin entries to the RSS feed? 2) 这种方法是否足够安全以防止非插件条目进入 RSS 提要? and 3) is there a simpler more efficient way of achieving this end? 3)是否有更简单更有效的方法来实现这一目标?

Your help will be much appreciated :-) Thanks.您的帮助将不胜感激:-) 谢谢。

You can easily create Webhooks in Google Apps Script through the use of Webapps .您可以通过使用Webapps在 Google Apps Script 中轻松创建 Webhook。 As an example:举个例子:

function doPost(e) {
  if (e.postData && e.postData.type == 'application/json') {
    var data = JSON.parse(e.postData.contents);

    var author = data['author'];
    var text = data['text'];
    var date = data['date'];
    var permalink = data['permalink'];
    var user = data['user'];
    // (...)
  }

This example code will parse the data received through a JSON post request.此示例代码将解析通过 JSON 发布请求接收的数据。 Afterwards, you can insert it to your Spreadsheet and generate an RSS feed usingXmlService (for more information on how to do it see this blog post).之后,您可以将其插入电子表格并使用XmlService生成 RSS 提要(有关如何执行 操作的更多信息,请参阅 博客文章)。 The RSS feed can be served using the doGet() method.可以使用doGet()方法提供 RSS 提要。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 从Google App Engine(Java版)将数据导出到Google Spreadsheet - Exporting data to Google Spreadsheet from Google App Engine (Java version) 从 Google Sheets 电子表格调用 python 脚本的好方法是什么? - What is a good way to call a python script from a Google Sheets spreadsheet? 如何以及检索单个实体Google App Engine的最佳方法 - How and the best way to retrieve a single entity google app engine 将App Engine数据存储中的数据导出为Google云端硬盘电子表格 - Exporting data from App Engine datastore as a Google Drive spreadsheet 将数据从gae数据存储区传输到Google文档电子表格 - Transferring data from gae datastore to a google docs spreadsheet Google App Engine频道API和Chrome扩展程序 - Google App Engine Channel API and Chrome Extensions 在Facebook上发布RSS Feed的最佳方法是什么? - What is the best way to publish RSS Feed on Facebook? 在Google App Engine上存储数据或查询数据的最佳方法 - The best way to store data or query data on google app engine Google Serverless function - 它可以运行一个进程还是只运行一个程序? - Google Serverless function - Can it run a process or just a single program? 从NDB数据存储聚合数据的最佳方法? - Best way to aggregate data from NDB datastore?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM