XRobots / IoT-Message-Board

MIT License
38 stars 15 forks source link

Goog Docs API #2

Open johntalton opened 4 years ago

johntalton commented 4 years ago

you might also what to look at the ‘modifiedTime’ via the doc api. might save the need to write cache-n-compare code.

https://developers.google.com/drive/api/v3/reference/files#resource

max19931 commented 4 years ago

and even viewedByMe to create expontial backoff if no changes were made!!!

harikattar commented 4 years ago

those "acell()" calls each establish a connection to google, authenticate, request data, receive it and close the connection, which is why it's so slow. You can get the entire column at once and limit it to the first 15 with something like the following:

olddata=next(csv.reader(f))
newdata = sheet_instance.col_values(1)[:15]
if olddata != newdata:
    # update screen here
    csv.write(",".join(newdata))
testataaaa commented 3 years ago

olddata=next(csv.reader(f)) newdata = sheet_instance.col_values(1)[:15] if olddata != newdata:

update screen here

csv.write(",".join(newdata))

Huh, interesting. I can't get this to work for me, but I'm new at this.

Combining the ideas above, how do I go about getting the entire column at once and then just checking for anything that was modified in the last 5 mins? My guess is then I would not have to have a log file at all?