GitPress - GitHub for your WordPress
Thursday, January 22nd, 2009 by Enrico
I had a little fun with the GitHub API last night: I created a small plug-in for WordPress called GitPress that provides a sidebar widget. The widget can be configured to show a list of repositories for any user on GitHub. It was pretty simple but it was a nice exercise because I learned a lot from it:
- How to create a WordPress plug-in and define a widget within it.
- How to create a widget control so that the widget’s attributes can be configured.
- How to store and retrieve widget attributes for rendering by using the WordPress options mechanism.
- Use PHP to call on a web API (using PHP’s curl library) and parse the resulting JSON (also using PHP’s library functions).
And all of this took me just a couple of hours after work. I got into a programming flow and I had fun. And now my mind is imagining many other cool things that I could do with it:
- Make it possible to have multiple instances of the widget with different settings. (I just finished this today!)
- Display more information than just a link to the repository (e.g. number of forks, number of watchers) and allow the user to choose how to format that information.
- Create another widget that displays news feed items for a GitHub user.
- Create another widget that displays recent commits for a project.
Some of this doesn’t seem possible through the current GitHub API but there are plans to add more features. Hopefully I can leverage the new features to build even cooler integrations with WordPress.
January 23rd, 2009 at 10:32 am
[...] We’ve also put together a simple Wordpress plugin called Taglets Feeder that will send comments GitPress - GitHub for your WordPress - tenthline.com 01/22/2009 I had a little fun with the GitHub API last night: I created a small [...]