New Writer Plugins Using The New SDK

As mentioned, and demonstrated, there is a new SDK for Live Writer and true to form, I have been beavering away with them writing up new plugins. This post will showcase the 6 plugins I’ve written using the new SDK. So let’s jump straight into it.

Emotify Plugin

You might remember that the first plugin I ever wrote for Live Writer was my Insert Emoticon plugin, where you clicked on the insert link on the right, chose your emoticon and put it in your post. Well I always found that to just be tedious and a pain, so with this new SDK, I can now take it one step further. So I have added to the original plugin and now you can simply do a Live Messenger emoticon code in your post The plugin will ask you if you want to emotify your post, or you can set the options to let the plugin do it automatically. This plugin was made using the PublishNotificationHook base class. I must note, this plugin requires .NET 3.5 to run (I wanted to try out some LINQ to XML. Joe is trying to persuade me to create one that is .NET 2.0 friendly, and I’ll try to, but for now, this is .NET 3.5. Would also like to thank Inky for his invaluable help with the regular expressions that do all the gory work. Thanks dude

Now Playing

There are many different plugins that allow you to put what you’re listening to into your blog and I think I’ve used each one, but this is a perfect example of a plugin that could utilise the HeaderFooterSource base class. And that’s exactly what I’ve done. The plugin itself is nothing special, it doesn’t even have its own API, but what it does allow is for you to customize what you want it to say and what parts of the song to show:

Now, a couple of things about this plugin, for it to work, you need to have the Windows Media Player blogging plugin which you can download here for XP or here for Vista. If you’re using iTunes, then you don’t need to install anything else, the plugin will query iTunes itself for the currently playing information.

Capitalize Title

This is a very simple plugin that will check to see if your blog title is using capital letters for the first letter of each word, if this isn’t the case, then it changes that. So a blog title would look like this: A New Blog Post Entry With Capital Letters (rather than: a new blog post entry with capital letters).

Signature Plugin

This plugin is quite unique as it has per blog settings! What this plugin does is uses the HeaderFooterSource and at the end of the blog entry will put a signature (like SL in my case). Now sometimes you want to use different signatures for different blogs (if you have more than one configured), so this plugin allows you to have different signatures for each blog configured!!

Bold Hyperlink Plugin

This was a request from Steve Clayton who wanted all of his hyperlinks to be bold, so that’s what this plugin does. It checks the contents of the blog entry and makes all the hyperlinks in the blog post bold.

Profanity Checker

This plugin was something I discussed with the Writer team as a good example of the PublishNotificationHook base class for checking the contents of a post and cancelling the publish if certain criteria are met. So this allows you to configure what words would cancel a blog post from being published, and just to make sure they can’t easily be changed (say by a child), you have to password protect them

ScottIsAFool.WriterUtilities

For some of these plugins, they all required some common code, so I have started compiling my own WriterUtilities static class. Now one of the methods you’ll find is a nice little trick for your Writer plugins. In the IPostInfo interface, all the properties (like title, contents, keywords, etc) are read only, so you can’t actually change them using your code. But wait a minute, isn’t that what I’m doing with at least 3 of the above plugins? Yes, yes it is. Using this WriterUtilities class, you can also change it too, but be warned, it is unsupported by Microsoft (and me ). Here is a quick example of how to use the class:

        public override bool OnPrePublish(IWin32Window dialogOwner, 
            IProperties properties, IPublishingContext publishingContext,
            bool publish)
        {
            string newtitle = "My New Title";
            return ScottIsAFool.WriterUtils.ReplaceText(publishingContext.PostInfo,
                newtitle,
                PostItems.Title);
        }

I also have a another method which returns an array of Blogs configured on the system (which I use for my Signature plugin). I should note that this utilities class is only compatible with the CTP and should not be used in the 1.0 SDK!

Source Code

As always I am making the source code for all these available on CodePlex.

Codeplex page: http://www.codeplex.com/NewLiveWriterPlugins
Download page: https://www.codeplex.com/Release/ProjectReleases.aspx?ProjectName=NewLiveWriterPlugins&ReleaseId=14010

All of these plugins should be put in c:\program files\windows live\writer\plugins (or the locale/architecture equivalent).

SL

Whilst writing this, I was listening to AerosmithLay It Down

Advertisements
  1. #1 by Steve on June 3, 2008 - 11:43 pm

    more plugin goodness from the plugin King!
     
    cheers Scott!

  2. #2 by Kelly on December 2, 2008 - 4:30 pm

    Excellent work here. Thank You.

  3. #5 by Unknown on March 9, 2009 - 9:06 am

    http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC+%E5%8C%BB%E8%96%AC%E5%93%81&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC+%E5%8C%96%E7%B2%A7%E5%93%81&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC+%E5%B0%B1%E8%81%B7&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC++%E4%BF%9D%E6%B9%BF%E6%B6%B2&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC+cm%09&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC+%E3%83%92%E3%83%AB%E3%83%88%E3%83%83%E3%83%97%09&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC+%E5%9F%BA%E7%A4%8E%E5%8C%96%E7%B2%A7%E5%93%81%09&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC+%E6%96%B0%E7%A4%BE%E5%B1%8B&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC+%E3%83%89%E3%83%A2%E3%83%9B%E3%83%AB%E3%83%B3%E3%83%AA%E3%83%B3%E3%82%AF%E3%83%AB&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC+%E6%8E%A1%E7%94%A8&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC+%E8%96%AC%E5%93%81&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC+%E7%97%9B%E6%95%A3%E6%B9%AF&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8%E8%A3%BD%E8%96%AC+%E6%BC%A2%E6%96%B9&btnG=%E6%A4%9C%E7%B4%A2&lr=

  4. #6 by Unknown on March 19, 2009 - 5:51 am

    http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E4%BF%9D%E6%B9%BF%E6%B6%B2&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E5%9F%BA%E7%A4%8E%E5%8C%96%E7%B2%A7%E5%93%81&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E5%9F%BA%E7%A4%8E%E5%8C%96%E7%B2%A7%E5%93%81&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E5%8C%96%E7%B2%A7%E5%93%81&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E3%83%92%E3%83%AB%E3%83%88%E3%83%83%E3%83%97&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+cm&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E6%96%B0%E7%A4%BE%E5%B1%8B&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E5%B0%B1%E8%81%B7&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E5%8C%BB%E8%96%AC%E5%93%81&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E8%96%AC%E5%93%81&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E6%8E%A1%E7%94%A8&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E7%97%9B%E6%95%A3%E6%B9%AF%09&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E6%BC%A2%E6%96%B9&btnG=%E6%A4%9C%E7%B4%A2&lr=http://www.google.co.jp/search?hl=ja&q=%E5%86%8D%E6%98%A5%E9%A4%A8+%E3%83%89%E3%83%A2%E3%83%9B%E3%83%AB%E3%83%B3%E3%83%AA%E3%83%B3%E3%82%AF%E3%83%AB&btnG=%E6%A4%9C%E7%B4%A2&lr=

  5. #11 by Unknown on April 8, 2009 - 11:01 am

    http://www.lanyoo.com/http://www.cezs.net/http://www.cxll.net/http://www.sdkc.net/http://www.skabrothers.com/http://www.vslc.net/http://www.ise-fj.com/http://www.goodwillstacy.com/http://www.ganabolsa.com/http://www.crosscountrycreations.com/http://www.consultingengr.com/http://www.comraderecords.com/http://www.camilohoyos.com/http://www.bostonteak.com/http://www.bfa-jr-balloonist.com/http://www.aslanband.com/http://www.aqualinkservis.com/http://www.15pt.com/http://www.zonatracker.com/http://www.jardichalet.com/http://www.iiwtexpo.com/http://www.braingymasia.com/http://www.bombasbeachbar.comhttp://www.appro-diffusion.com/http://www.7th-wcec.com/http://www.b0010.com/http://www.b0009.com/http://www.b0008.com/http://www.b0006.com/http://www.b0005.com/http://www.b0004.com/http://www.b0002.com/http://www.b0001.com/http://www.agozono.com/http://www.annberrybush.com/http://www.besprenmyass.com/http://www.bni-dearborn.com/http://www.bot-builders.com/http://www.bulgariandiary.com/http://www.micro-webserver.com/http://www.cms-sk.com/http://www.crimepundit.com/http://www.cypx.net/http://www.darlingangelbabies.com/http://www.dfpk.net/http://www.diyalogavrasya.com/http://www.dorit-regev.com/http://www.genealogical-exchange.com/http://www.gigglesgroup.com/http://www.gsmy.net/http://www.hairgarage1.com/http://www.hamiltonvaluation.com/http://www.hd17.net/http://www.hn99.net/http://www.icimco.com/http://www.lamatlock.com/http://www.lostriverinnbedandbreakfast.com/http://www.ludb.net/http://www.nhtequipos.com/http://www.niremusic.com/http://www.sexandpatriotism.com/http://www.soundtrackslive.com/http://www.splodeswag.com/http://www.stlouisbirthinjurylaw.com/http://www.sumadia.com/http://www.szpromising.com/http://www.teleinsula.com/http://www.tmialanko.com/http://www.ukch.net/http://www.websilkdesign.com/http://www.westvirginiacasa.com/http://www.xf19.com/http://www.xumm.net/http://www.zeeroovers.com/http://www.jamesgaitisarbitrator.com/http://www.nadiayer.com/http://www.naraschool.com/http://www.rmpap.com/http://www.wako-events.com/http://www.zghl.net/http://www.aurevoirspasalon.com/http://www.b0003.com/http://www.kalomusic.com/http://www.hijackingcatastrophe.com/http://www.jolytoy.com/http://www.sensorsbank.com/http://www.verdi-system.com/http://www.eter.biz/http://www.thewatercitygrill.com/http://www.thankyoufornosmoking.com/http://www.openirc.net/http://www.nvrc.net/http://www.mgdermatoloji.com/http://www.k4ul.com/http://www.johnwolfington.com/http://www.pxarts.com/

  6. #12 by Unknown on June 17, 2009 - 4:19 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: