Github API - example code

I am working on a project in which I intend to leverage the Github API.
I have found a few Ruby Gems, but none that seems quite “ready for prime time”.

Do you have experience with (or have written yourself) a good Gem for access to the Github API?

Do you have a snippet (Gist or other) of sample code that demonstrates:

  • Authentication with OAuth/OAuth2
  • Access to a list of Public Gists (just as an example)

I have Registered the application in Github; so I have a ‘Client ID’ and ‘Client Secret’

No examples but for Oauth there should be some solid gems that implement that, requests should be easy on top of it.

Not a whole lot of ruby seat time so I don’t have any more.

Hey,

For oauth I’ve just used omniauth with the facebook/twitter adapters but omniauth-github should do the same.
The ‘gh’ gem works for cases where you want to access private repos


@gh || = GH.with(
  username: ENV["github_username"],
  password: ENV["github_password"]
)

There’s a good public JSON api’s you can use also.
https://api.github.com/users/markbrown4/gists
https://github.com/markbrown4.json

All the best,

That is great. Thanks for the response.

@[COLOR=#0000FF][B]ParkinT[/B][/COLOR][URL=“http://www.labnol.org/internet/github-gist-tutorial/28499/”]

I recently received the above blog post mostly about Github Gists.

What I liked mostly was the

http://bl.ocks.org/

demo:

http://bl.ocks.org/mbostock/1353700

and one from me:

http://bl.ocks.org/John-Betong/raw/c59cc4e260d65d7cf98d/

Notice the addition of /raw/ after username, in the last URL. This prevents source code display.

Whoa. That is really cool.
There are many, many creative ways people have applied the Github API. I am playing with it.

Thanks for sharing that.