Versatile RESTful APIs Beyond XML

An article I wrote has just been published over at InfoQ. It’s called Versatile RESTful APIs Beyond XML and shows how easy it can be to extend Rails’ RESTful behaviour to input and output resources not only as XML but also as JSON and Microformatted HTML. The article builds on some posts on this blog, such as Intercepting Microformats In Rails Input, but offers a bit more context. The timing of the article fits nicely with a post on the microformats-rest list about Rails, REST and microformats, so hopefully we’ll see more discussion of these concepts over the coming weeks. ...

March 14, 2007

Rails Geo Plugins: acts_as_geocodable

acts_as_geocodable ( blog entry, repository) is the newest kid on the rails geo plugin block. It actually consists of two parts, a gem called graticule which handles the actual geocoding, interacting with external services, etc, and the plugin which offers extensions to your models. I like that separation. Having the generalised code in a gem and the rails-specific hooks in a plugin makes a lot of sense and makes it much easier to use the core code in non-rails ruby apps, and having a single gem that supports multiple services allows for built-in failover should the preferred geocoder be unavailable. ...

March 7, 2007

Governmental Pipes

I’ve refrained from blogging much about Yahoo! Pipes, mainly because everyone else seemed to be. It’s definitely an interesting development, and shows how far we’ve come with open data, but also how far we still are from that really making an obvious impact for non-geeks. Two of the more interesting pieces on the use of Pipes that I’ve seen so far are two blog entries that Tim McGhee pointed out on the govtrack list. He’s done some work using Pipes to repurpose various feeds about government activity, and they’re worth a look. Check out: Managing the volume of content from Congress and Geek Out: Mashing Yahoo! Pipes and the Congressional Record over on his blogs. ...

March 6, 2007

Relax over REST

Mark Nottingham has a good post running through a few topics on which people get needlessly caught when designing RESTful applications. If you’re new to working on RESTful application design (as many rails developers are) it’s worth checking out to save yourself needless anguish. Thankfully for Rails developers at least some of the issues he identifies will be a little simpler than they might be for people designing systems from scratch. In particular, while there are a few URL design choices (numeric IDs, other parameters, or a hybrid? nested vs. flat?) the conventions are good and changing isn’t all that hard. ...

February 27, 2007

More on OpenID

It seems DHH is hopping on the OpenID bandwagon, and that the next 37signals app will allow openid-based authentication. He’s talking about releasing his code as a plugin, so maybe I won’t need to find the time. For those following the OpenID buzz, Simon Willison’s cool things you can build with OpenID is well worth reading to begin to get a sense of the new opportunities opened up once we have unique IDs for users that map between sites. And the comments on this post at Tim Bray’s site may help people with some lingering questions. ...

February 26, 2007

Jumping On

Bandwagon is a soon-to-be-launched service to help people back up their itunes libraries. It provides online services (and it looks like tools) to manage and store the backups. They’re also offering free accounts to bloggers linking to their site, and I’d really like to try the service, so here’s my post. I’m a little sceptical that it’ll be practical to do online backups of our main itunes library, seeing as how it’s just steamed past 175GB and our DSL connection isn’t at the high end. But I’d love to be proven wrong… ...

February 19, 2007

Input formats and content types in Rails 1.2

One feature of recent releases of Rails I hadn’t spotted before is the ability to define your own parameter parsing based on content type. I’m working on an application that will employ a RESTful API and that I hope will take its input in either standard http parameters, microformatted HTML, XML or JSON. I don’t really want to have to write custom code within the controllers to interpret the input based on content type, so I started looking for how rails parses XML input and came across the following in the actionpack changelog: ...

February 3, 2007

Bus routes on Rails

Following on from my previous entry about scraping bus route data from The Rapid’s website, and to begin to demonstrate the possibilities it opens up, I’ve set up a simple web service to provide route and stop data. It’s based on the new REST style from Edge Rails, and routes are scoped by city to allow for future expansion. To get data on Route 1, GET: http://projects.jystewart.net/buses/cities/1/routes/1 To get a list of the stops within 1.5 miles of a given longitude and latitude, GET: ...

September 25, 2006

Embedding PHP with Smart Pill

It’s always an interesting challenge to take a system you are familiar with and try to use it in an entirely new way or context. That’s what I’ve been getting with PHP of late. As more and more of my web development work moves to Rails, I’ve had the chance to work on PHP embedded within Filemaker Pro as I’ve tested and explored Scodigo’s new Smart Pill plugin. For those of us used to programming in full-fledged languages, writing scripts and functions in filemaker can be quite a challenge. Writing and debugging all that recursive code is a time-consuming process, and communicating with external processes isn’t really worth the work without plugins. Smart Pill changes all that, by opening up the entire PHP (5.1.4, including many extensions) engine for use within Filemaker. ...

August 15, 2006

Exploring Greenbelt with Last.FM

My particular focus this year as a member of the Greenbelt web team is on finding ways to better integrate festival related content with the wider web, and then working out how to use the festival’s website as a hub for all of that information. It started out with the collage that we built using flickr photos, del.icio.us links, and blog entries around the festival last year, and the next step (the first longer term one) is integration with last.fm. ...

February 11, 2006