Show Commenter's Latest Post: BlogEngine.NET Extension

Background

Over the past few weeks, I’ve seen a few WordPress blogs that pull in the last post from a commenter’s website. I also saw a post from Mads about how to find semantic links on a webpage.

So, I mashed his code together with some code from the BlogRoll control and created an extension that goes out and looks for RSS feeds at the commenter’s website and then pulls in the latest post. [side note: I wish I could say, “a half hour later … “, but it actually took me a while to get it to work…]

It all happens asynchronously, so if you comment on this post, it’ll take a few seconds for it to show up. Then it will keep checking every so often for new posts.

Example

Last year, I posted a JavaScript color picker and the post now has over 100 comments. Here’s what it looks like with the extension running:

 Comments with Recent Posts

Download & Installation

  • Download Commenter’s Latest Post Extension
  • The last post is wrapped in the following class so you can style it:
    <span class="commenterslastpost"></span>
  • Sometimes the ResolveLinks extension interferes with this, so you might want to add the following code around the foreach loop:
    if (e.Body.IndexOf("href=\"" + match.Value + "\"") == -1) { ... }

Add a comment to this post to see it in action…

8 thoughts on “Show Commenter's Latest Post: BlogEngine.NET Extension

  1. Think I’m gonna start using this soon. By the way Jon, can you please add a tag cloud to your blog. Would really help navigation.

Comments are closed.