googledrive
googledrive copied to clipboard
get comments from docs
Follow-up to this thread: https://twitter.com/joelgombin/status/887403982422978561
It would be great to be able to get comments from (e.g.) spreadsheets. One common issue is that people use them (and formatting) to convey useful information that exporting spreadsheets to CSV doesn't allow to preserve. I guess these could be stored in the attributes of a tibble, for example.
I think this is a great idea, but we have to solidify the basic features first.
In the meantime, I happen to have chosen comments as my example when documenting how to use our low-level functions to hit endpoints we have not "pre-wrapped". See here:
https://tidyverse.github.io/googledrive/reference/make_request.html
If you want to play around soon, that should get you started.
ha, thanks a lot!
I found the build_request example very useful to get started!
In case others are looking for additional examples I have some simple ones here:
https://github.com/markdly/googledrive-comment
Thanks very much @markdly, that's great! I could imagine making an article out of these, so I might add your examples to mine, if that's ok.
Not a problem at all @jennybc - use whatever you can!
At the moment the examples aren't particularly 'reproducible' but I could add a little bit extra so the examples work 'out of the box' if you thought that would help.
Currently, this example is broken:
https://github.com/tidyverse/googledrive/blob/master/R/request_make.R#L65:L77
> library(googledrive)
> req <- build_request(
+ path = "drive/v3/files/{fileId}/comments",
+ method = "GET",
+ params = list(
+ fileId = "your-file-id-goes-here",
+ fields = "*",
+ pageSize = 2
+ ),
+ token = googledrive::drive_token()
+ )
Error in build_request(path = "drive/v3/files/{fileId}/comments", method = "GET", :
could not find function "build_request"
Something like this works:
req <- request_generate(
endpoint = 'drive.comments.list'
,params = list(
fileId = "your-file-id-goes-here"
,fields = "*"
)
,token = googledrive::drive_token()
)
do_request(req)
Sidebar: I updated the example to reflect that build_request() no longer exists and should be replaced with gargle::request_build(). I re-ran the example with success.