re: A quick way to create Google documents. VIEW POST

FULL DISCUSSION
 

I saw this post and it got me thinking. You can totally do this programmatically with Python. The script below is Python 3, but this would work with 2 as well without the 'f' string:


import requests
import webbrowser

def open_google_doc(doc_type):
    r = requests.get(f'https://{doc_type}.new')
    webbrowser.open(r.url)

open_google_doc('sheets')

Something tells me this has potential of some sort, but I have no idea what it would be. Let me know if any of you could think of a reason to use this :P

 

That is an interesting thought. I'll now be pondering that one too, but I have no good answers.

A very crude way of logging when an event happened?

 

For me, my inner web-scraping wonders if there are other browser commands that can be exploited in a similar way. Perhaps the correct json data in a header for requests could open and append data to a new document. Then, a different request could read it back. Perhaps this could be used for a quick notes web app, or filtering system for data you currently have in a spreadsheet, or retrieve a particular slide? That way you can do quick, one-off reads and writes from a front end UI that leverages the in-place cloud infrastructure of the g suite rather than building your own? Then anybody who can collaborate on those docs could do the same, no Docs API key necessary. Hmm....would this be the type of framework any web devs would find useful?

code of conduct - report abuse