Wednesday, March 28, 2007

Digg This plugin for Windows Live Writer

Update (08/01/07): Source code now available on CodePlex.

Digg This plugin for Windows Live Writer is a plugin to insert a "Digg This" button into to your Windows Live Writer posts. It is a wrapper to the API described in the Integrate: "Digg This" Button page at Digg.

Digg This Sidebar Editor

If you already use Digg, you will surely know how to use this plugin. The functionality is designed to closely match the online submission form. The Sidebar editor is broken into two tabs: General and Appearance.

The General tab contains the information used as defaults for the submission to Digg. The Appearance tab contains properties that allow you to modify the way the Digg This button will look when published.

The simplest way to use this plugin is to specify a post title, specify at least one paragraph of text that will describe briefly the post, place the cursor wherever you would like to insert the Digg This button and click on the Insert Digg This... option in the Sidebar. You will notice that the post title is used for the submission title and the first paragraph is used for the submission text. The first time one of your readers clicks on the button once the post is published, they will be sent to the Digg site to submit the post to Digg. The defaults you specified will appear for the user to either use as is, or modify accordingly.

Some of the features of the Digg This plugin are:

Auto-selection of Title & Text – The Digg This button has the ability to accept recommendations or defaults as part of the submission link. These parameters are used to pre-populate the respective fields when a user submits an entry. Instead of having the submitter type their own text, which they can still do during submission time, the Digg This plugin will take the post’s title and the first paragraph in the post body and use these as the suggested Title and Text properties in the Windows Live Writer Sidebar, respectively.

Submission Character Count – Just like the online submission form on Digg for the Title and Text fields, the number of remaining characters available will appear in the status bar of the Windows Live Writer Sidebar.

Visual Layout of Digg This Button – Using the Appearance features present in the Windows Live Writer Sidebar when the object is selected, you can modify the Layout, Text Wrapping, and Margin properties and see them apply immediately.

Tooltip Help – All fields have an associated tool tip that provides more details about the specific use of that field.

Persistent Options – Changes to the Digg This properties can be used as defaults. These include layout and submission properties, accept for Title and Text, which get overwritten whenever a new instance of the Digg This button is inserted in a post.

Download Digg This plugin for Windows Live Writer Setup

25 comments:

Sunil Bajpai said...

Can't wait to install this plugin.

Another to similarly insert google ads into the posts would be also wonderful.

Leo Vildosola said...

It is currently being tested by the Windows Live Gallery group. It should be up soon at their site.

Would you have some specific links with the details for Google Ads. I want to read about what you would have in mind, instead of me doing research from scratch.

Leo Vildosola said...

The plugin has been approved and is now available for download from the Windows Live Gallery. Feedback is always appreciated.

Anonymous said...

i'm psyched to see this, but can't get it to work. i keep trying to fix my .NET install, but it all seems fine. running XP sp2 MCE.

System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
at WLWPluginBase.Win32.Win32IEHelper.GetHtml(IntPtr handle)
at DiggThis.DiggThisPlugin.ExtractPostTitle(IntPtr owner)
at DiggThis.DiggThisPlugin.CreateContent(IWin32Window owner, ISmartContent newContent)
at WindowsLive.Writer.PostEditor.ContentSources.ContentSourceManager.PerformInsertion(IContentSourceSite sourceSite, ContentSourceInfo contentSource)

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

Leo Vildosola said...

Sorry I have been unable to answer your question earlier. Can you tell me if you still have the problem? What version of IE do you have on your system?

Food Lovers Diary said...

Okay, a couple of problems with this.

On blogger, the Digg information is only the page URL - it does not seem to be picking up the title or description information.

Also, it is picking up the actual page URL and not the one I filled into the form (so just the front page of my blog)

And I am not sure what font you wrote the readme in, but it is coming out as symbols on my machine.

Joss

Leo Vildosola said...

Thanks for your feedback. Let me see if I can answer all your concerns.

There are differences between WLW Beta 1 and Beta 2 in the way the post's underlying HTML is prepared. As you may know or not, I scrape the underlying post's HTML code to extract such information as Title and Description. I have made the necessary changes to the plugin to support WLW Beta 2 but have not submitted it for publication. The new version of the plugin will only be good for WLW Beta 2.

Frankly I have been so busy I just forgot to publish it. So, I will get that going. In the mean time, if you send me an e-mail I will be happy to send you a copy that will work with WLW Beta 2.

I am not sure about your second issue. I will have to look at that one. The only thing I remember is that in Blogger I changed my template so that certain parts do not appear in the main page and do appear in the post page. Perhaps you would be interested in that. If you could verify for me if the link is correct when you are inside the post itself. If so, then I may know what the issue is.

As for the Readme file, I don't use anything special. I just checked it and it uses a mixture of Cambria and Calibri. I will make sure this is updated to use Arial throughout. It looks like Office 2007 uses these and I just did not notice. Thanks for bringing this up.

Leo Vildosola said...

I did further testing regarding the links issue with Blogger and this is what I found.

The Digg API (JavaScript) defaults to assuming that you will place a single link (Digg This instance) on a page. If you put more than one link on the page without explicitly specifying a URL for each, then the page holding the link will be the Digg URL to use.

However, if you override the URL then it uses that URL for the explicit link and any other subsequent links where the URL is not specified. Setting the URL value in the Digg API will cause Digg to think that is the URL to use.

To recap the issue, the problem is that since it uses JavaScript to hold the URL, whatever value is held will be used everywhere unless you override it. A concrete example can help illustrate the problem better.

Consider the scenario where you add 2 links (in Blogger it would simply mean 2 posts in your main page). The first link (oldest post) does not specify a URL, the second link (the newer post) does specify a URL. Because of what I described above, all links after that link where you specified the URL (first link in this example) will use the URL you specify in the second link.

The workaround is either to change your Blogger template to not display the Digg This button when on the main page. Or specify the URL for all Digg This instances. I use the former for my site.

Food Lovers Diary said...

Hi Leo

Thanks for all that - how do I email you?

Leo Vildosola said...

Sorry, thought I had posted it. You can e-mail me at "lvildosola at htcal dot com". I can send you the build I will be submitting for publishing.

Anonymous said...

Hi Leo-

I think the plugin is a great idea!

I just tried it out on my wordpress blog, and it worked one time, but now every time I try to incorporate the Digg button on any other item it points back to the first story - even if I change all the information in the sidebar in WLW.

Any thoughts?

Thanks!

Vik
guidephilly.com

Anonymous said...

Hey Leo-

I think its a great idea. For some reason when I use it all the "digg this" buttons point back to the same story (the first one I did).

Thoughts?

Leo Vildosola said...

Look at a couple of comments back. I explain this same issue in some detail. Can you tell me if you have the buttons on your main page? That is, do you see more than one on the same page?

Anonymous said...

Leo-

Thanks, I didn't see the comment about forcing the URL on subsequent Digg's.

I'll give it a shot and see if that resolves the problem!

-Vik

Anonymous said...

Great tool. Just enabled it on my site!

Anonymous said...

Hi Leo, this is a great tool. I just installed it on WLW (latest version).
I'm not sure if you've mentioned this problem in your previous comments, or not, but I can't get the URLs to stick.

When I put the DiggThis in a post, and view the post at its own url the DiggThis URL is correct. But on the main page, the DiggThis URL is that of my main page.
Attempting to set the URL manually for the DiggThis block doesn't change that. Is this something your latest beta fixes? Is there a way I can get a copy of that?
Thanks very much.

Leo Vildosola said...

Yes, I have mentioned that previously. This is a known problem with the Digg API implementation. I will take a look at the latest API and see if they somehow managed to fix it. Perhaps I can find another way to do it.

I get around it by hiding the button when it is on the main page and only showing it in the individual pages. I do this trick in Blogger by modifying the template. I don't know what blog engine you have but if it is Blogger I can probably share how I did it.

Anonymous said...

Hi Leo, thanks for the response. I use WordPress for my blog, but I would still be interested in the script that you use if you would like to share. If you don't want to post it in on the web, my e-mail address is dev at benwatson dot org

Leo Vildosola said...

Ben, sorry for the delay responding. I have been crazy busy and have had little time to post.

Do you still want the information you requested?

Anonymous said...

Thanks for the work, but I seem to have similar issues like other people and I'm not having multiple Digg Buttons on the front page. Also, it does not seem to use the compact apperence, even though it's in the Javascript.
I'm using Wordpress. I see that people had issues with Wordpress on the Download page. Any news on that?

Anonymous said...

Leo, I "dugg" a little deeper. It's def a Wordpress problem.
See my blogpost:
http://remy.supertext.ch/2007/11/dotnetkicks-plugin-for-wordpress-and-live-writer/

If one installs Text Control the problem can be fixed.

Leo Vildosola said...

Remy, thank you very much for the link. I have been trying to figure out what to do about this for a long time. Hopefully, others will be able to use it in Wordpress also.

GottfriedHaus said...

I cannot get the "digg this" Button to work on my wordpress blog. Do you know how to fix this?

Leo Vildosola said...

See Remy's response 2 comments up. He had a link where he documents the issue.

Ash Wu (hSATAC) said...

Hi!I use your WLWPluginBase to get the whole html in Live Writer successfully. But the next thing I want to do is clear all the html and paste the html that i modified. Could you give me some hints how to do it?thx a lot