DotNetKicks "Kick It" Counter Plugin for Windows Live Writer

Posted October 21st @ 7:53 pm by aaron

Some people write pretty quality .NET-related blog posts every time. You know, stuff worth posting and kicking on DotNetKicks. Then there’s people, like me, who obscure the occasional “good” post with a mountain of crap. If you don’t know what DotNetKicks is, I encourage you to check it out. It’s a great community-edited feed of .NET-related posts, with minimal “noise”.

I found myself wanting to add a “kick it” counter on some of my posts to enable people to easily kick them (via their blog reader, for example), but not on every post. I mean, who wants to kick a post about contacting me? Not even I do!

Here would be the process with what I’ve currently got:

  1. Write a kick-worthy post.
  2. Publish the post.
  3. Get the permalink for the post in question.
  4. Submit the post on DotNetKicks.com, and copy the HTML for the “kick it” counter.
  5. Add the HTML to my just-posted post, and re-publish the updated version.

Way too manual. So after a little research and a little coding today, here’s my new process:

  1. Write a kick-worthy post.
  2. Click Insert Kick It Counter... from Windows Live Writer.
  3. Publish.

The Problem

It’s simple, really: adding the “kick it” counter requires knowing the permalink of a particular post. That prevents me from inserting it for real at creation time, because the permalink isn’t known until the post is published. I could just add the “kick it” code to my wordpress template, but as I originally mentioned, I don’t want it on every post - just some. (Yes, I realize I’m overcomplicating things - it’s my blog though. :) )

The Solution

Unfortunately any solution, including mine, will require some cooperation between Windows Live Writer and the blogging platform. Mine includes a Windows Live Writer plugin and a Wordpress plugin. The Windows Live Writer plugin adds a placeholder (”<!–dotnetkickit–>”) to the post, and the Wordpress plugin transforms the placeholder into the “kick it” image/link HTML at render time.

Windows Live Writer Plugin

The Windows Live Writer plugin adds an “Insert Kick It Counter…” link in the list of “insertable items.
image

Click it and, like any other inserted item, a default “kick it” image is added.
image
This image is static, and is just for layout purposes only - Windows Live Writer allows plugins to insert different “editor” versus “published” HTML. When editing, I insert a static image so you can get the look-and-feel, and when published, only the “<!–dotnetkickit–>” placeholder gets inserted. Pretty nice on the part of Windows Live Writer to expose that functionality.

When you select the image, you’ll see the “Kick It Counter” properties on the right, of which there are none:
image

That’s really all there is to the plugin, it’s pretty basic. It doesn’t (currently) allow you to change any of the colors, but that’s something you could manually update in the Wordpress plugin itself, if you want.

To install the plugin, download and run the MSI available on my garage sale code page listed under “DotNetKicks Windows Live Writer Plugin”.

Wordpress Plugin

The Wordpress plugin is beyond simple, partly thanks to the extensibility support the Wordpress developers have built in. The plugin adds a filter that modifies the post content before it gets displayed in the browser. Note that I don’t actually modify the stored post content itself - I want to be able to turn this off and have the “kick it” counters go away.

To install, download and unzip the dotnetkicks.php file from my garage sale code page (listed under “DotNetKicks Wordpress Plugin”). Just upload it to your wp-content\plugins subfolder, and activate it from your admin page:

image

After activating, you’ll see the “kick it” image on the appropriate posts.

kick it example

If anybody wants to create plugins or whatever for other blogging platforms that will interpret this placeholder, post a comment here with a link to your implementation!

Finally

The moment we’ve all been waiting for - I’m going to make use of the barely useful tools I created! Feel free to kick this post. :)

kick it on DotNetKicks.com

7 Trackbacks/Pingbacks

  1. Pingback: 6 Links Today (2007-11-01) on November 1, 2007
  2. Pingback: Chief of the System Blog » DotNetKicks Plugin for Wordpress and Live Writer on November 27, 2007
  3. Pingback: DotNetKicks with WordPress | DMB Consulting Blog on December 20, 2007
  4. Pingback: DotNetKicks "Kick It" Counter Plugin for WLW and WordPress by JohnnyCoder on February 10, 2008
  5. Pingback: DotNetKicks PlugIn for Windows Live Writer : JohnPapa.net on April 30, 2008
  6. Pingback: DotNetKicks PlugIn for Windows Live Writer - John Papa [MVP C#] on April 30, 2008
  7. Pingback: Alkampfer’s Place » Blog Archives » A simple try for the KickIt plugin on May 10, 2008

2 Comments

  1. Remy Blaettler
    November 27, 2007 at 16:56

    Hey Aaron
    Thanks a lot for the tool. Works perfectly. Would it be possible to do a similar tool for Digg Buttons? I’ve tried some other tools, but your approach seems the best one for Wordpress. Or can you release the Source Code?

  2. aaron
    November 27, 2007 at 17:21

    I’ve released the source on my Tools page:
    http://www.aaronlerch.com/blog/tools/

    It’s released under the MIT License, which basically means “have at it”. :)

Leave a comment

OpenID Login

Standard Login

Options:

Size

Colors