Show your favorite websites’ articles with Feedbin
May 30th, 2008I’ve created my first Wordpress plugin, and it’s available for everyone. FeedBin is a lightweight RSS aggregator plugin made with simplicity in mind. You can use it to promote your favorite websites in a more substantial manner, by displaying their latest articles on your blog. It works by reading and parsing the latest entry of their RSS newsfeed, and linking it back to their page. The article title is displayed below the title of their website (which also links back to their homepage). Those site owners will tend to notice trackbacks more when they see that another site always has their articles on display.
I am aware that other solutions exist, such as the included WP widget for feeds and Magpie’s Wordpress Plugin, but I wanted to create my own stripped down approach to feed aggregation. So yes, FeedBin is an article scraper of sorts, but I tried to be cautious on not letting it slow down loading times and performance. Bloggers usually don’t like for their articles to be scraped, but that’s in cases where the scraper doesn’t point back nor gives credit to the original owner. This is not the case with FeedBin, which was created as a promotional tool.
Now, how to use FeedBin
By now I would assume that you know how to install plugins if you’re a regular user of Wordpress. FeedBin 1.0 is very easy to use. First, create a folder called “cache” in your Wordpress blog’s root directory, which will store the RSS feed info locally. Then, install the plugin. Once installed, you will be able to access it from the Manage tab, and then selecting the “FeedBin” suboption in the menu below it. Follow the simple on-screen instructions; there’s only one form field to fill out, which is for the RSS feed URLs.
The features are very bare-bones for now and there are limitations. It only displays the last article published for each feed, but this is what I considered all along. You can display a maximum of 10 feeds to link back to. Deactivating the plugin will not delete the URLs.
The Technical Side
FeedBin uses the very lean LastRSS parser to pull RSS feeds, and I modified the parser a bit for FeedBin’s specialized purpose. Its primary function is a wrapper that calls LastRSS’s own output function, and it “cleans” and formats the feed to reduce it down to just the necessary content. Additionally, it uses the caching function provided by LastRSS to increase performance. This way, articles aren’t fetched every single time a browser loads the page. Cache time is set to 3600 seconds, so this is the amount of time FeedBin will check for new content.
Currently it’s in beta but it’s very possible to use on your own blog right now. A known issue is that invalid URLs would show an ugly caught exception message. I want to keep that exception handling, but will try to make it invisible to users in the future.
Styling the Feed List
To stick with good coding standards, FeedBin displays the links and articles as an unordered list. One CSS selector is used for the list. You can style it by using the following selector:
ul#feedbin_list
And style all list items as:
ul#feedbin_list li
Each list item (article link with website title) also has a numerically ordered id that is named as “feeditem_##”. You can style each item individually with its corresponding order number (starting with 1).
What’s Next
For newer versions of FeedBin, I hope to add maintenance options in the Wordpress admin area, such as force clearing the cache and setting your own cache time. Currently, you only need to add one line of code in your theme to use the plugin, but it might as well be one line too many. It is one of my goals to make FeedBin widgetized, so that theme editing won’t be necessary, as well as making it more adaptable for Wordpress updates. Let me know how version 1.0 is working out for you and I’m open for suggestions you might have for future updates.