I recently started using yelp.com extensively because their google map search mashup is so damn handy. When I’m trying to find a place that I know is in a general area I find it’s the quickest way to find things. The reviews are usually pretty good too.
I started writing brief reviews on yelp and thought I should add it to awardtour. So you should now see a new section on the main page’s sidebar entitled “seattle reviews”. It shows my 3 latest reviews and the rating I gave the place. I initially thought that adding this should be pretty simple, “there must me a wordpress plugin to source an rss feed”. Well, there is but there were problems at every turn.
Fair warning, what follows is a very nerdy explanation of the problems I had. If you don’t know what xlst is or care about HTTP response codes, then you might want to stop reading and trust me when I say that it took more effort than need be.
I first tried out inlineRSS which is designed to take any rss feed and use an xslt to output it. I’ve never really used xlst before but, after trying to do just a few simple things, I hope I never do again. At this point, I can’t see why anyone would use xlst for anything. So I looked for another plugin and came across feedlist. After tweaking it a bit (for formatting mostly), I gave it a try and it failed miserably. It turns out that magpie, the php library that wordpress uses to retrieve rss, doesn’t handle HTTP 301 redirects. At this point I had spent about 4 hours working on something I thought would take 1 hour at most. So I googled my 301/magpie issue and found out that people had the same problem with ma.gnolia and that someone wrote a ma.gnolia specific wordpress plugin. It uses lastRSS instead of magpie and it thankfully handles 301s. So I downloaded this plugin and hacked in a few changes: pointed it to yelp, changed the formatting, and limited the description to 160 characters. This probably took 20 minutes. Et voila.
What’s foolish is that if I had just tried a simple integration test on the first 2 plugins I wouldn’t have wasted so many hours tinkering with them. This is foolish because this is one of the few facts of software development that I’ve learned in my job. Get an end-to-end test working first, then worry about the rest.
Anyways, I think I might clean this script up and add some formatting options like the Wordpress Get-Recent-Comments plugin (which is really well done) and put it out there for other wordpress+yelp users.
I’m sorry you had to go through so much trouble with feedList. I know it isn’t very clear on the feedList homepage (well it is a little more now) but there is an older version of feedList - rssLinkList - that also uses lastRSS (and thus works with mag.nolia).
feedList moved to using magpie because it is built into wordpress and I wanted to make configuration easy - unfortunately it worked out to make it harder for you.
I hope to eventually combine the two so that feedList falls back to lastRSS if the magpie effort fails. (magpie supports ATOM feeds which lastRSS doesn’t).
“This is foolish because this is one of the few facts of software development that I’ve learned in my job. Get an end-to-end test working first, then worry about the rest.”
Bingo. So true.
XSLT is one of those things that must have seemed like a good idea when everyone had a really big hard-on for anything to do with XML. When I worked at the computer systems group, part of their research was specifying programs & problems in XML, and using XSLT to generate corresponding C code.
it’s amazing how much people used xml in the late-90s to early-00s, even when it made no sense. i did a contracting gig at a major bank the other year and they managed to overuse xml in ways i couldnt even imagine. and since they were using software like oracle8 and the first version of MSXML and so the performance on xml processing was downright atrocious.