googledrive icon indicating copy to clipboard operation
googledrive copied to clipboard

get comments from docs

Open joelgombin opened this issue 8 years ago • 7 comments

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.

joelgombin avatar Jul 20 '17 10:07 joelgombin

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.

jennybc avatar Jul 20 '17 15:07 jennybc

ha, thanks a lot!

joelgombin avatar Jul 20 '17 16:07 joelgombin

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

markdly avatar Sep 01 '17 03:09 markdly

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.

jennybc avatar Sep 01 '17 04:09 jennybc

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.

markdly avatar Sep 01 '17 05:09 markdly

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)

brooksambrose avatar Aug 24 '21 22:08 brooksambrose

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.

jennybc avatar Aug 25 '21 19:08 jennybc