Hacking a Gist API with Mechanize
I’ve been wanting to hack in support for code snippets with syntax highlighting for Get Satisfaction for quite a while. After Gist was released, I had the bright idea to allow our users at GSFN to easily create gists, since they give you so many nice features.
So, I did that today. Unfortunately, the slowness of the service is too much overhead, on both the embedding side and the uploading side, and so I’ll wait until they get a little faster. In the meantime though, I have this quickly thrown together piece of code to interface with gist from ruby, allowing you to either upload or delete gists. Might as well share it.
It uses ruby mechanize, so you’ll need to gem install that first, but otherwise, here’s the code: (obviously, presented to you as a gist)