DEV Community

Discussion on: A quick way to create Google documents.

Collapse
 
kaelscion profile image
kaelscion

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

Collapse
 
mark_nicol profile image
Mark Nicol

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?

Collapse
 
kaelscion profile image
kaelscion

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?