Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add endpoint for gist commenting #84

Open
jthomasmock opened this issue May 10, 2022 · 11 comments
Open

Add endpoint for gist commenting #84

jthomasmock opened this issue May 10, 2022 · 11 comments

Comments

@jthomasmock
Copy link

jthomasmock commented May 10, 2022

Howdy! Really enjoying the package, any chance that y'all would add the Gist comment endpoint?

Gist comments API

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): ![](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): ![](https://i.imgur.com/rXkoukl.png)"
@sckott
Copy link
Contributor

sckott commented May 12, 2022

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?

@jthomasmock
Copy link
Author

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. 👍

@maelle
Copy link
Member

maelle commented May 13, 2022

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. 😉

@jthomasmock
Copy link
Author

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?

@sckott
Copy link
Contributor

sckott commented May 19, 2022

@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?

@maelle
Copy link
Member

maelle commented May 20, 2022

I don't see an app whose name looks like it's that. 🤔 (I did clean up recently though 🙈 )

@jthomasmock
Copy link
Author

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

Screen Shot 2022-05-20 at 10 14 31 AM

@maelle
Copy link
Member

maelle commented May 20, 2022

Good digging 🕵️ 👌

@sckott
Copy link
Contributor

sckott commented May 24, 2022

@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

@maelle
Copy link
Member

maelle commented May 30, 2022

@jthomasmock ICYMI https://httr2.r-lib.org/articles/wrapping-apis.html#github-gists-api :-)

@ScientificProgrammer
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants