Author Topic: Read/write Google Docs with TorqueScript  (Read 1804 times)

I want to set up a system for reading/writing to Google Docs (specifically Spreadsheets) from Blockland. This could be useful for visitor logs, quick rule changes, data storage for an RPG, or pretty much anything that needs a database. I should only need two functions: getGDocCell(docID, col, row) and setGDocCell(docID, col, row, val); where docID is that random letters part of the doc link, col/row are the column/row of a cell (what else?), and val is the value to set the cell to. I could add doc creation/deletion, login, styling, etc. functions later, but this is what I'm focusing on right now.

The problem is I can't find any sort of web API for this. What I can find is some .NET/Java thing, which I'm assuming is useless for TorqueScript. So - does anyone know of some sort of Google Docs web API or another way to do this that I haven't considered?

« Last Edit: June 23, 2014, 02:41:22 PM by 0xBRIANSMITH »

I honestly don't understand half of that, but it looks like that's majorly outdated. It seems to use a ClientLogin system, and half of Google's sites about APIs and such keep going on about "we're using some OAuth2 thing now and it's so much better and ClientLogin is deprecated". Also, for now I'd prefer not to mess with login systems and just change public/unlisted docs.

Google docs forces https and you can't use that with torkscript.

Google docs forces https and you can't use that with torkscript.
oh then you'll need an external program running in order to get this to work.

Maybe you could store values in csv/json files and use an Excel plugin to open them. Unless the point of this project is being able to access these values anywhere?

Maybe you could store values in csv/json files and use an Excel plugin to open them. Unless the point of this project is being able to access these values anywhere?
Google docs forces https and you can't use that with torkscript.


Sorry if I wasn't clear enough. I meant abandoning the use of google docs and opting to use Excel with csv/json files, assuming that he wants a simple interface to view and edit the values. It would not have the portability of Google docs.

You could try symbolic links + csv/json files for portability. I've hacked up this kind of setup before. Basically:
Use the Google Drive/Dropbox app. They create a folder of your online stuff, right. Then you make a folder in Google Drive/Dropbox and put your csv/json files in. You symlink that folder to a folder in the Blockland directory. Now you can access the files from Blockland.

If you happen to have a VPS/Dedi/Server/Whatever on your hands, you could host a node.js, PHP, or a python server on it to parse the info for you and then have it send to you.

Torque connects to server, server connects to google docs, and the data comes back.

If you happen to have a VPS/Dedi/Server/Whatever on your hands, you could host a node.js, PHP, or a python server on it to parse the info for you and then have it send to you.

Torque connects to server, server connects to google docs, and the data comes back.
If you're going to do this you might as well just have the data source on the server as well

Yeah, the point here is I want an easy way to read/write a spreadsheet of some sort from Blockland while also having the same spreadsheet available online. All I have to work with is Google Docs and a small home server that probably wouldn't be able to handle public (maybe even private) usage, so.