DotNetKicks "Kick It" Counter Plugin for Windows Live Writer

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

This entry was posted on Sunday, October 21st, 2007 at 7:53 pm and is filed under blogging, tools. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

15 Responses to “DotNetKicks "Kick It" Counter Plugin for Windows Live Writer”

  1. 6 Links Today (2007-11-01) Says:

    [...] DotNetKicks "Kick It" Counter Plugin for Windows Live Writer | Aaron Lerch [...]

  2. Chief of the System Blog » DotNetKicks Plugin for Wordpress and Live Writer Says:

    [...] http://www.aaronlerch.com/blog/2007/10/21/dotnetkicks-kick-it-counter-plugin-for-windows-live-writer... [...]

  3. Remy Blaettler Says:

    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?

  4. aaron Says:

    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”. :)

  5. DotNetKicks with WordPress | DMB Consulting Blog Says:

    [...] I found was a guy who’d figured a way to get the code snippet into live writer.  But, you still have to insert the tag.  However, he did have a plug-in that gave me [...]

  6. DotNetKicks "Kick It" Counter Plugin for WLW and WordPress by JohnnyCoder Says:

    [...] WordPress AND Windows Live Writer is your go-to editor AND your posts tend to be .NET related, give Aaron Lerch’s DotNetKicks “Kick It” Counter Plugin for Windows Live Writer a try.  Again, it works like a charm.  Well, if I am being completely honest, I [...]

  7. DotNetKicks PlugIn for Windows Live Writer : JohnPapa.net Says:

    [...] I tried using the some of the Windows Liver Writer plugins that are available on CodePlex and other places, but none that I found did exactly what I wanted. So I decided to create a Windows Liver Writer [...]

  8. DotNetKicks PlugIn for Windows Live Writer - John Papa [MVP C#] Says:

    [...] I tried using the some of the Windows Liver Writer plugins that are available on CodePlex and other places, but none that I found did exactly what I wanted. So I decided to create a Windows Liver Writer [...]

  9. Alkampfer’s Place » Blog Archives » A simple try for the KickIt plugin Says:

    [...] But I decided to try to contribute, and I found a really interesting plugin for Windows Live Writer here. I’ve installed also the WordPress related plugin, so let’s see if all [...]

  10. Matthew Doig Says:

    Guess i must be slow, but how do i get the button to show up in wordpress? I’ve installed the plugin, actived it, and now what?

    I’ve tried inserted into the html and nothing happens.

  11. aaron Says:

    It works for me on the latest version of Wordpress – what version are you using?

  12. Matthew Doig Says:

    My bad aaron. It does work from Live Writer. Somehow i thought the posts was a live writer or wordpress plugin instead of a live writer and wordpress plugin. I hate live writer (why can’t you paste code straight from visual studio and keep the formatting?) so i’ll have to keep looking for a solution.

  13. aaron Says:

    Matt, just keep in mind that the wordpress plugin works regardless of authoring tool – as long as there’s a “” comment on the page, it’ll be replaced.
    Good luck!

  14. Matthew Doig Says:

    And I call myself a programmer! Yikes! I finally opened up the php file to see what it’s doing and found out my problem straight away. I was putting in

    instead of

    at the end of my posts. Works like a charm, thanks.

  15. Jack Says:

    Thanks for sharing, I’ll have a try.

Leave a Reply