Welcome to MSDN Blogs Sign in | Join | Help

DDITDev

A crack team of devs in the Developer Division. ASP.NET, SQL, C#, development practices.
Windows Live Writer Plugins & Dirty Diapers!

I've been playing around with Windows Live Writer for a little while now (since it first came out in beta!) and the more I use it, the better it seems to get (in case you haven't used it, I encourage you to check it out).

The only "problem" I've had so far is my lack of understanding on how to create plugins for it. Well my friends - I've worked it out and I intend to share it with you now!

Oh! Before I go any further, let me explain the title of this post...

I've been wanting to write this post for a little while now, but this is the first chance I've had to sit down and have some "time to myself". My wife and I welcomed our new baby daughter into the world a few weeks ago and since then my world has been turned upside down! When I'm not changing diapers, or bonding my her and my wife, I like to try and catch up on the little sleep I seem to be getting at the moment! But just for you (OK.. and me!) I have managed to escape to my office for a while and finally get this article "out the door"... ;)

Anyway, let's get going!

The first step to writing a plugin was working out what I wanted it to do. I finally settled on creating a plugin to insert a thumbnail image of any given web page and have it appear as an image in your blog post.

I was going to write this post about how you create a plugin yourself, but I thought the best way to show you would be to provide the source code for my plugin!

A few points worth mentioning...

  1. When creating a plugin, make sure you add a reference to the WindowsLive.Writer.Api.dll file located in the Program Files\Windows Live Writer directory.
  2. Make sure you add attributes to your class describing the plugin. This is how Windows Live Writer "learns" about your plugin. Mine looks like this:

[InsertableContentSource("Website Image"),

                  WriterPlugin("32a77b7a-5ea4-47be-84fc-ff7471384e10",

                  "InsertWebsiteImagePlugin",

                  ImagePath = "Web.png",

                  PublisherUrl = "http://blogs.msdn.com/jasonward/",

                  Description = "Inserts a thumbnail image of a website into the Live Writer Window"),

                  LiveClipboardContentSource("html", "text/html"),

                  UrlContentSource("http://(.*)",

                  ProgressCaption = "Capturing Website Image..",

                  RequiresProgress = true)]

    public class InsertWebsiteImage : SmartContentSource

So what's the plugin called and where can I get it?

It's called "Insert Website Image" and you can download it from here!

All source code can also be downloaded from here!

Hope this helps,
Jason

p.s - I've hosted all the source code on codeplex, so if you'd like to contribute to this plugin or perhaps even add your own plugin to this project, please let me know!

Posted: Monday, February 19, 2007 5:00 PM by dditweb

Comments

frankarr - an aussie microsoft blogger said:

Thanks to Jason from DDITWeb, here's a really useful WLW Plugin - It creates a thumbnail of a website.

# February 19, 2007 11:54 PM

Steve Clayton: Geek In Disguise said:

Spotted by Frank , a very cool new plug-in for Windows Live Writer. This one inserts a thumbnail of a

# February 20, 2007 3:17 AM

DDITWeb said:

If you've read my earlier post, Windows Live Writer Plugins & Dirty Diapers! , you'll know that I'm

# June 1, 2007 12:30 PM

barbbowman said:

I really want the insert website image plugin to have an option to open the hyperlink in a new window. I tried editing the HTML to add the target sntax but it gets stripped out every time.

# July 8, 2007 5:10 AM

trent said:

Check out Thumbnailspro.com, they are FREE while in beta any allow to request thumbnails directly from your website, any size you want up to 1000pixels! WOW! thats <a href="http://thumbnailspro.com" alt="website thumbnails" title="website thumbnails">Thumbnailspro.com</a>

# August 26, 2007 11:42 AM
Leave a Comment

(required) 

(required) 

(optional)

(required) 

  
Enter Code Here: Required

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Page view tracker