Tuesday, May 1, 2012

A gallery view for Craigslist

A gallery view for Craigslist

As much as I love Craigslist, I sometimes find the interface a bit limited.

My biggest wish? That there was an option for showing the search results as an image gallery, like eBay has. This could prove quite useful for browsing things like antiques, furniture, art: categories where I only need a quick glance at an object's picture and I immediately know if I am interested or not. Craigslist does have an option for embedding pictures to the search results, but their size and resolution are so small it is quite impractical.











Here is a short R program I have put together that does the job. As much as possible, I have tried to break it into small and meaningful modules so it will be easy to maintain and build upon.

First, a function for turning a query into a Craigslist URL:

Then a function that reads the search results and recombines them into an image gallery:

Finally, an interactive function for wrapping everything together:

Not quite a full R/Craigslist API, but one step in the right direction!