Skip to content

Integration with GitHub Gists #6

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

Closed
wycks opened this issue Jan 7, 2013 · 10 comments
Closed

Integration with GitHub Gists #6

wycks opened this issue Jan 7, 2013 · 10 comments

Comments

@wycks
Copy link

wycks commented Jan 7, 2013

Very cool, I just found this and I started to hack up an idea where it can get a list of Gists (by user or starred) and then fetch the Gist snippet.

I was wondering if this would be a good idea to integrate into this plugin or if you're interested.

@sheabunge
Copy link
Member

Very cool! You can fork this repo and send a pull request. I'll review your code, perhaps modify it a bit, and then merge it into the core plugin files.

One thing, Gists usually start with an opening <?php and close with ?>, which is not allowed with Code Snippets.

@wycks
Copy link
Author

wycks commented Jan 7, 2013

It's ends up being a little more complex then I though since GitHub now requires Authorization for requests since anonymous ones are severely limited, also the output would need to be parsed, I'll play around with it.

@sheabunge
Copy link
Member

Actually, since this seems like a rather large addition, and it would involve external requests, how about making this a separate plugin? Code Snippets includes lots of hooks and functions, and I could always add more if needed. I would be happy to open up a shared repo and we can work on this together, if that sounds good to you.

@sheabunge
Copy link
Member

I've created a repo at https://github.com/bungeshea/code-snippets-gist. If you can dump your code in there, once you've finished fiddling around with it, and I'll take a look at it.

@wycks
Copy link
Author

wycks commented Jan 8, 2013

I'm really busy so not sure when I will get around to it, but I agree there are some issues with requesting info from an external API that might make it better if it stayed in a fork since all sorts of things can go wrong, it will end up being pretty sizable. During coding I ran into a limit request so I have to figure out how to deal with that, also parsing could be tricky and I kinda want it to work with via ajax.

Thanks for repo I''ll dump some code in there as I go

@sheabunge
Copy link
Member

I was not suggesting a fork - that would create many frustrations with naming colisions and duplicate code. Rather, you could create a completely new plugin, and use the public functions avaliable in the $code_snippets global variable. For example, to add a Gist to the database, you could use the $code_snippets->save_snippet(); function. I'm working on documenting this on the wiki.

@sheabunge
Copy link
Member

Any updates on this @wycks?

@sheabunge sheabunge reopened this Nov 15, 2013
@wycks
Copy link
Author

wycks commented Nov 16, 2013

No sorry , I did have a working version but it did not use GitHub's Authentication API for requests so I want to rewrite it, but I'm just too busy.

@sheabunge
Copy link
Member

That's fine. If you ever decide to rewrite it, I'll happy to help with the integration with the main plugin.

@levikszabo
Copy link

I would love to see this happening guys! please add gist/github integration!

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

No branches or pull requests

3 participants