A long time ago, I wrote Huddled Parser to parse pretty much all versions of news feeds. It works on RSS .92 and 1.0 and 2.0 and ATOM, and even handles feeds with Yahoo’s media enclosures thumbnails embedded (like flickr feeds). I finally got tired of hacking that into each of my themes when I switch them around on the site, so I decided to write up a WordPress plugin.
Since I’ve recently been playing with DomTT tooltips for my ubernyms plugin, I figured I’d go ahead and take the time to add that to the Huddled Parser plugin as well, so you have several options for what to do with the images and descriptions that are in the feed (show them inline, show them in DomTT tooltips, or don’t show them). I’ve been careful to make this work with ubernyms, but I had to make a new release of that to keep them from both inserting the DomTT javascript (so, if you also use ubernyms, please go upgrade that to Version: 2.3 before installing this).
You can download it here, and I’ve included some base CSS you can modify, and plenty of options for parsing feeds: from limiting the length of the snippets of content, and headlines, to setting the maximum number of items you pull from each feed. To get the feeds to actually show up on your page, you just add a single line to your template: < ?php get_huddledparser_feeds_list(); ?>
The biggest thing, however, is that this plugin cache’s everything religiously. The result of that is that you can control how often the feed gets fetched from the server to avoid pounding other people’s servers, and to avoid too much slow-down on your own site as well. The best part is that not only do the feeds get cached, but the images get cached locally too.
Clearly, I’m a bit of a nincompoop sometimes, I left out a bit in this description, so here are the answers to the most frequent questions.
You should unpack the whole folder into your WordPress plugins directory, including the huddledparser.php plugin and the css file, especially if you want to use the feed css or domTT tooltips and it’s css.
The two feeds (currently) on my front page are both coming from the plugin and are styled entirely with CSS. You should be able to style yours any way you like, and to help you there are two special features: You can pass in a class name that will be added to the list (to the UL tag), like: get_huddledparser_feeds_list( "HPFeeds" ); And a sanitized domain (the domain of the feed) will be added as a class on that same ul, so if you had my flickr photos feed, in your feed list, and had passed “HPFeeds” as the class,the complete class list rendered would be: HPFeeds flickrcom so you can target each feed with your CSS, even if you’re parsing multiple feeds, as I do.
18 Jan
A long time ago, on a domain not my own, I wrote a PHP parser that handled pretty much all versions of RSS/RDF xml feeds. I released it for free, and a few people used it. It wasn’t pretty code, but it was small, and it was easy to use, and it didn’t care what sort of feeds you threw at it., it just chewed them up and spat out links. In fact, it didn’t even care if those feeds validated perfectly.
Today I’m releasing the first ever upgrade of that script.
(more…)