The blogroll has become a standard element on most blogs today. If it is an ASP.NET blog, the blogroll probably contains links to other ASP.NET blogs and that gives the visitor an opportunity to surf to other related websites. The only problem with it is that you have no idea what to expect from the blogs by looking at the blogroll. Most often, the link title on the blogroll contains the name of the author and if you don’t know him/her on beforehand, you have no idea if it’s a related blog or not.
That got me thinking about a way to tell a little more than just the name of the authors. Why not display the titles of their 3 latest posts so the visitor quickly can see what the blogs are about?
By showing the newest posts beneath each blog we also stop the visitor from leaving your site for an unrelated one.
The code
In order to display the latest posts we need to parse all the blog’s RSS feed, which means that we have to retrieve them first. That is time consuming, so it has to be done asynchronously so it doesn’t slow the entire page down. It doesn’t have to be updated with each request but only every hour or whenever you see fit. By each update it still mustn’t slow the page and I found a way to do that.
The first time the blogroll is created it displays the blogroll without the latest posts. After it has retrieved the feeds it adds them beneath each blog. It takes less than a second per blog and is cached until the blogroll will be updated. The default is one hour.
Implementation
The blogroll is a user control and you add blogs to it like this:
private void CreateList()
{
AddBlog(".NET slave", "http://feeds.feedburner.com/netslave");
AddBlog("Vault Of Thoughts", "http://vaultofthoughts.net/SyndicationService.asmx/GetRss");
}
You can set the different variables on the control itself like this:
<uc1:blogroll ID="Blogroll1" MaxLength="30" MinutesCached="60" VisiblePosts="3" runat="server" />
There are 3 properties to set:
- MaxLength: The maximum number of characters to display for each post
- MinutesCached: The number of minutes before it updates the posts
- VisiblePosts: The number of posts to show beneath each blog
Download
blogroll.zip (2,66 KB)
Some of my friends have been considering moving to Vista and have therefore asked me if it’s worth the money. My answer is an unconditionally yes, but then they ask why that is and what features are worth the upgrade? That’s an easy question to answer because there is only one big feature that is far superior to XP and that is security. I know there are hundreds of details and sub processes that are far better in Vista, but it is hard to point them out to a regular computer user and it’s definitely not a selling point they can relate to. Try telling someone that Vista is much more stable than XP, when that person’s XP machine never crashes or that the .NET 3.0 runtime shares more components between worker processes. They just can’t relate.
Herein lay the essence of the problem that is emerging in many software products nowadays. Security gets too much attention. Think about the features that were announced to be included in Vista but didn’t make it because lack of time, such as WinFS. Instead Microsoft concentrated on security, security and more security.
The Live Messenger API has also been locked down so you can’t send files or do anything that could be used to spread vira or other nasty things. Because of security, the Messenger API is completely useless and no new cool products can be made by third-parties on top of it. The problem is not the security itself, but in the things it effects. In Vista it had the effect that Microsoft had to cut back on other important features too make the deadline. In the Messenger API it totally ruined the usefulness of it.
What happens when security gets too much attention is that other features gets neglected or cut from the final product. In cases like the Messenger API it slows innovation and decreases the freedom for the developers. That is a major concern. To what length are we willing to go for securing our applications when it comes to cutting back on functionality? It depends on the type of application of course, but the question remains. Security is damn important, don’t get me wrong, but so is innovation.
Luckily for me, the Messenger API is free and I don’t have to pay for Vista, but to build an entire system where the only real selling point is security is the unsexiest thing to do and I would never buy it on that argument alone. I have never had anti virus software installed on my XP and I have never had a single virus neither. I sometimes run an online virus scanner that finds absolutely nothing. So for me, the extra security features are a nuisance and makes my workday harder.
Security is not the opposite of innovation in any way, but it can be if you let it. Just think of all the cool things that didn’t make it in the Vista release in the name of security.