How to Use Custom Post Types to Automatically Display Google Code Project Commits on Your WordPress Site

How to Use Custom Post Types to Automatically Display Google Code Project Commits on Your WordPress Site

This is a tutorial for developers who host projects with Google Code and blog with WordPress. Suppose you could create an automatically-updating archive of your SVN activity for a project you’re working on? The Google Code Commit Tracking plugin for WordPress 3.0 allows you to do just that!

Whenever you make an SVN commit on a Google Code project, you can instruct Google to send a notice to someplace else. This plugin enables WordPress to receive those notices and output them as an SVN Activity custom post type. You’ll be able to view them in a list under the SVN Activity custom post menu in your dashboard:

How to Link Your Google Code Project’s SVN Activity to Your WordPress Site

If you’re setting up your Google Code account for the first time, make sure to select SVN for your repository type if you plan to use this plugin.

  1. After installing Google Code Commit Tracking on your WordPress site, go to your Google Code account and copy the Post Commit Authentication Key from the Administer > Source.
  2. Paste into the Settings > Google Code options page.
  3. Copy the Post-Commit URL on the Config page into the Google Code Post-Commit URL field on Administer > Source.
  4. Then you can create a custom page template for the page where you want to display the updates and query the SVN post types using something like this:
    1
    
    <?php query_posts( 'post_type=svn'); ?>

Now you have a page that will update automatically every time you commit, without you having to do a thing. This is especially useful if you are collaborating on a project with other developers or have a number of people interested in your project who don’t use Google Code. Importing your SVN activity as custom post types lets your site’s visitors to interact with your project by commenting on the updates and following via subscription. Keep everyone up to date with your project directly through your WordPress site!