Ron Fredericks writes: This is my first WordPress Widget development effort, or my first WordPress *anything* pretty much. However, I provide my best effort to offer a complete and useful widget following the guidlines published by WordPress and the spirit of quality. It is a widget following Atomattic’s Widget offering for managing our blog’s sidebar. It was inspired by a conversation with a friend of mine, Mukesh Lulla, co-founder of embedded security software provider TeamF1. Mukesh suggested that I might want to have a list of news and blog links that are relevant to my user base. This is the resulting widget I dreamed up. I hope you like it, but your comments and guidance are welcome either which way.
You can see Embedded Components‘ blinesAgg widget in action on this blog’s sidebar with the title: Embedded Device Updates
You can download and extract the zipped blinesAgg.php version 1.0.2 widget from here: blinesAgg.zip
The blinesAgg WordPress widget displays a list of selected news and blog RSS syndicated feeds as a list of links:
- Links can be collected from a neat RSS service called Bloglines
- Links are collected using the Bloglines search engine
- You select the desired search words to search for links you think might be cool for those that read your blog
- No user account on Bloglines is used, just their search engine
- Any number of additional RSS feeds can be aggregated from extra sites to complete your list
- Page access to RSS feeds can be cached using an embedded copy of lastRSS, by Vojtech Semecky, for efficient use of your web server
Once blinesAgg widget is installed, you can configure the widget using a simple web form:
- Number of links to display
- Bloglines search parameters: search words to use, and search words to exclude
- *List of other RSS feeds you would like to include in your list of aggregated links
*Because sometimes there may not be enough links found within your requested Bloglines search. Given some combinations of search and avoidance words, you may want to list extra RSS feeds to be used to fill out the remaining total number of links you would like to display. That’s why I added the extra feeds form entry. But, you may want to skip the Bloglines search feature and just use the extra feeds as your RSS aggregator.
Installation on your server:
- Place the php widget file (blinesAgg.php) in your WordPress wp-content/plugins/widgets subdirectory. You can skip all the optional installation steps [2 to 6] that I suggest next.
- Optional Installation: For speed and reliability I modified lastRSS to use cURL to read remote web pages, if your server does not support cURL then disable this feature using this global configuration variable (*): $USEcURL. The cURL feature also includes a timeout parameter. Timeout is set initially to 20 seconds. If your list of links fails to appear, you may need to change this parameter (*) too: $cURLtIMEOUT. See the optional installation test bullet point below to see how to identify specific problems, where their located, and how to fix them.
- Optional Performance Improvement: Create a subdirectory for cache storage of feeds with read/write privilege. For the subdirectory to be readable and writable on a UNIX box, you will need to use the command: “chmod 777 your_cache_directory”. Then let your blinesAgg widget know about it using some predefined global variables I have defined for this purpose. You can: activate, define cache subdirectory, and set cache refresh time using three global configuration variables (*): $USEcACHE, $CACHEdIR, and $CACHEtIME. Note: if you create a cache directory named “temp” in your widget subdirectory, then you can just use the default setting I already defined for $CACHEdIR. When you download the widget from my site here, the initial default setting for cache is to be disabled. To use the cache technique, you would still have to change this global variable to enable the cache feature: $USEcACHE = true.
- Optional duplicate display control: I notices that Bloglines search engine returns with some titles nearly duplicated but from diffrerent web sites. Use this flag to control the skip duplicated titles feature (*): $SKIPdUPS
- Optional control of named anchor link: Use this named anchor within other hypertext links to referr to your blinesAgg widet on your blog’s home page. The default setting (*): $BLINESaNCHR = ‘blinesAgg’. Usage: example: http://www.embeddedcomponents.com/blogs#blinesAgg
- Optional Installation Test: To verify that your installation is done correctly, you may want to set the debug variable below (*) named $DEbUG to “true”. Then complete configuration as usual and view your blog sidebar. With this debug feature activated, your configuration panel may show error messages if something is not configured correctly. Also, you should see your maximum number of links under the Title you defined without any error messages. Press your browser’s page refresh a few times to exercise the widget. Any errors encountered will be displayed by the php error handler activated as a result of setting the $DEbUG variable to “true”. The error handler will report error number, error text, and line number within blinesAgg.php where the error occurred. My suspicion that my new cache directory was not working properly was the reason I added an error handler in the first place. Indeed based on the error report, I failed to change read/write privileges for the cache directory. To fix the problem I had to launch a telnet session to change the read/right permission of my cache directory on my web server using chmod 777. Meanwhile, I had placed the cache directory in the wrong place so I had to move it into the correct subdirectly. I’m talking about the directory you create and the path to it as defined by $CACHEdIR and its read/write permission. If all is well, you can disable the debug feature by resetting the $DEbUG variable to “false”. If this seems confusing, as it did for me at first, then just leave the cache disabled until you really want or need the speed advantage.
*References to configuration parameters means that you would open the php file using a text editor or something like Dreamweaver, and locate the first few lines of php source code below the initial comments in the program file blinesAgg.php. I show the default settings for all global configuration variables in the next section – below.
Optional configuration within blinesAgg.php source code [with default settings shown]:
$DEbUG = false;
$USEcURL = true;
$cURLtIMEOUT = 20;
$USERaGENT = "Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0)";
$SKIPdUPS = true;
$BLINESaNCHR = 'blinesAgg';
$USEcACHE = false;
$CACHEdIR = './wp-content/plugins/widgets/temp';
$CACHEtIME = 3600;
$INITtITLE = "Bloglines Aggregator";
$INITmAXCOUNT = '10';
$INITtAGS = array('embedded', 'device');
$INITnOTAGS = array('engineer', 'job', 'engr');
$INITeXTRAFEEDS = array('http://feeds.feedburner.com/embeddedstar', 'http://slashdot.org/slashdot.rdf');
Configuration within WordPress:
The figure presented here shows what options are configurable from within the widget menu. Default values are shown using IE 6 browser.
- Enable the Bloglines RSS aggregator widget plugin from your "administrator -> plugins" menu
- Drag your blinesAgg widget to the sidebar from your "administrator -> presentation -> sidebar widgets" menu
- Open the widget and configure your blinesAgg widget using the built-in form for: title, number of entries to display, search words that must appear in the Bloglines link text, and search words that must not be present in the Bloglines link text
- Because sometimes there will not be enough links found within a Bloglines search given some combinations of search words, you may configure extra RSS feeds to be used to fill out the remaining total number of links you would like to display
- To skip the Bloglines RSS search feature altogether, and just use this widget as your RSS feed aggregator, then just delete the search words during configuration
- Close the widget and save your changes. Visit your WordPress home page to see the list of new found links displayed in your sidebar.
Some initial notes on compatibility:
- I only tested it with WordPress 2.04 using a modified default theme
- It seems to work under all typical conditions on Mac OS X and current FireFox and Safari web browsers, as well as PC Windows XP with IE 6
- During dynamic configuration I did notice that Mac OS X and Safari web browser (only) does not work to configure any Widget. This is because the link to open the configure menus are not visible. FireFox worked OK but with some less than perfect background color issues
- I would like to thank the folks at Atomattic for giving us the WordPress Widget along with sample widgets from which I learned how to develop blinesAgg
- I would like to thank Per SÃ¸derlind for introducing me to the power of Vojtech Semecky's lastRSS.php object code and how to use it to collect RSS feeds as a WordPress plugin through his blog posts
- Bloglines Search Engine
- WordPress Widgets by Automattic
- WordPress widgets home page
- WordPress list of widgets submitted by the community
- Widgetizing Plugins
- Vojtech Semecky's lastRSS.php object
- Per SÃ¸derlind's introduction to RSS feed aggregation using lastRSS
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License (GPL) as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
To read the license please visit: