citizen428.blog()

Try to learn something about everything

Fun With the GitHub API and Ruby

Often when I want to tell someone about cool projects I’m watching on GitHub, I can’t remember their names. Now wouldn’t it be nice if I could look them up without actually having to open a browser tab, logging into the site and so on? Here’s a quick script to do just that:

Example output (shortened):

1
2
3
4
5
mbabineau/cloudviz: Makes nice graphs of Amazon CloudWatch data using ...   (14)
quirkey/sinatra-gen: Rubigen based generator for new sinatra projects        (126)
      jcoglan/heist: Scheme in as little Ruby and as much Scheme as pos...   (125)
        red667/tecc: The Euler Coding Collective                             (7)
       fogus/potion: _why the lucky stiff's little language                  (39)

I know that there are several gems for interacting with GitHub, but thanks to the awesome HTTParty it takes about as long to just implement the relevant part of the API yourself as it would take to actually find said gems, install them and glance over their docs. In case this looks a bit over-engineered, I have a couple more ideas I might add in the future, so I already prepared the code for that (e.g. the API_METHODS hash). Once I do that I’ll also not hardcode the user name, separate out… who am I kidding, it’s just another throwaway script, but at least it’s somewhat useful…

Comments