gistr
gistr copied to clipboard
Add endpoint for gist commenting
Howdy! Really enjoying the package, any chance that y'all would add the Gist comment endpoint?
I am successfully using something like the below, but that requires me to use some undocumented internal functions, primarily gistr:::gist_POST(). Primary usecase is adding Imgur hosted-images to gists, given that images aren't supported in upload.
gist_comment <- function(gist_id, body,...) {
body <- jsonlite::toJSON(list(body= body), auto_unbox = TRUE)
res <- gistr:::gist_POST(paste0(gistr:::ghbase(), '/gists/', gist_id, "/comments"), gistr::gist_auth(), gistr:::ghead(), body, ...)
res$body
}
Code in action:
my_comment <- "### Code image at [https://i.imgur.com/rXkoukl.png](https://i.imgur.com/rXkoukl.png): "
gist_comment("c91a26923377ffdbbee7edbb7e2f4855", my_comment)
#> [1] "### Code image at [https://i.imgur.com/rXkoukl.png](https://i.imgur.com/rXkoukl.png): "
hi @jthomasmock - thx for the issue. i'm not maintaining this anymore. @maelle is going to put a call out for new maintainers - do you have any interest?
Ah gotcha, sorry for the drive by request!
I'll take a look but not ready to commit to maintaining as of yet. Not very familiar at all with OOP in crul. Would have to think on it. 👍
See #85 (I'll also put it in the newsletter). Thanks @sckott!
FWIW @jthomasmock if you become the maintainer, you can swap dependencies to better fit your preferences. :wink:
Continuing to think this over 😃 - in the meantime, @sckott - do you mind sharing the callback URL you are using for the gistr_oauth app so I can do some local testing?
@jthomasmock I would but I don't see it in my account, it's probably an app in the github org account i'm guessing. @maelle could you look?
I don't see an app whose name looks like it's that. :thinking: (I did clean up recently though :see_no_evil: )
I was able to find the gistr_oauth app in my connections/applications/settings at: https://github.com/settings/connections/applications/89ecf04527f70e0f9730
Not sure if that app ID is a global GUID, but it looks like it may still be under your account @sckott

Good digging :detective: :ok_hand:
@jthomasmock i found it finally, sorry about the delay. github UI change and I'm totally lost. here's the callback url
http://localhost:1410
@jthomasmock ICYMI https://httr2.r-lib.org/articles/wrapping-apis.html#github-gists-api :-)
Hi Everyone:
I'm writing to let you know that I haven't forgotten about this issue. Rather, in addition to trying to decide out how I should address this issue, I'm also trying to understand where I can start editing in a way so that I don't break the package with my first contributions. I'm going to follow up with @maelle via our Slack channel to get some tips for first time contributors to an rOpenSci package.