14
votes

I want to write a custom script using Google Apps Script for Spreadsheet that gets data from WebSocket. Is there a way doing so?

1
Can your WebSocket get/send HTTP responses? Try the UrlFetchApp goo.gl/GvP0i6contributorpw
You might not need Google Apps Script at all. Check out the sheet functions IMPORTXML and IMPORTDATA It rather depends on what you need, how often and from where.JSDBroughton
You could probably try to implement your WebSocket communication in the code that calls the App Scripts API. For example in an Add-On you would do your WebSocket communication in some javascript code of your sidebar and then pass the data as parameter to your App Script functions.ndreisg

1 Answers

6
votes

No, Google Apps Script does not include any Web APIs other than what UrlFetchApp offers. In particular, it cannot maintain a websocket connection.