1. A MarsEdit friendly XML-RPC server in CodeIgniter

    October 26, 2010

    Part of the custom software powering the new version of this site is a small and very basic MetaWeblog API compatible XML-RPC server, allowing me to manage the weblog section of the site via software such as MarsEdit, a tool I previously used when editing my Expression Engine powered website. The decision to build such a solution came from not wanting to build any kind of web-based back-end, but also not wanting to have to edit database rows directly to make posts. As CodeIgniter contains an XML-RPC library, (for which there isn't much in the way of good documentation, or many examples on how to interact with common APIs such as this one), I thought it would be simple. It wasn't, so I uploaded some examples to help others navigate through the problems I encountered.

    I've uploaded a controller similar to the one used on this site, and added additional comments to guide users. The controller, which initialises the server, only makes use of the MarsEdit interpretation of the MetaWeblog API, consisting of seven of the methods documented here on Microsoft.com. There are no methods implemented for returning information on the user or the blogs available. If these methods are required in future releases, they should be pretty simple to implement based on the examples laid out here.

    I've also enclosed an example model file that demonstrates user authentication and shows how requests could be used to manipulate a weblog's contents. There is no real information manipulation since there is no database layer, but the model shows enough about the format that the data should be in and the parameters that each request passes through.

    Finally, I created a simple XML-RPC helper file that takes the array structures returned by the default CodeIgniter database class and converts them to the struct format that is required when sending responses via the MetaWeblog API. I found the struct format confusing to read and messy to implement in PHP so using a helper allowed me to abstract this away somewhat, keeping the core code much tidier. On this website I also use Markdown as a means of formatting my posts. It's relatively simple to integrate Markdown into CodeIgniter as a helper - just download the latest PHP implementation and save it as markdown_helper.php in your application's helpers directory.

    The files are available to download from GitHub. The default CodeIgniter file structure has been preserved but only the files I created are present. Please fork the repository if you find any bugs or make any improvements.

  2. Flickrshow Seven

    January 4, 2010

    By far the most popular of any of my personal projects is Flickrshow, a Javascript slideshow that evolved from earlier gallery projects into the first public version in 2006. For those unfamiliar with the project, the goal is to allow as many people as possible to embed a slideshow displaying Flickr images into a webpage. The emphasis has always been on simplicity and ease of use, rather than complex features, and this has led to its use by scores of people who most likely would have resorted to poorer implementations or worse, none at all.

    After a hiatus of over a year, I recently released the newest version of Flickrshow to public beta testing. The previous version had no real faults, other than a few glaring feature omissions, but was definitely showing its age. The goal of this new version was to add a few of the most requested features and, more importantly, remove another level of complexity to the implementation by removing any framework dependance from the slideshow, (it was previously using the Prototype framework).

    This version of Flickrshow uses only native Javascript functions, and contains its own animation and remote loading functionality. It now features auto-play, configurable pop-up controls, better themes, multiple shows per page and improved integration with Flickr. It is also compatible with all modern browsers, (although by making use of certain CSS properties it will look slightly less rounded and transparent in older software) and the size of the script has been reduced from 58Kb to 8kb. If you are interested in the project, please try out the new version and register any issues.