JiuJitsuProGear Affiliate Plugin for Windows Live Writer

I blog a lot about Brazilian Jiu-Jitsu.  I like to add to my blogs items from JiuJitsuProGear.com.  It was a pain having to create affiliate link using their nebular look up page.  So I created a Windows Live Plugin that does it for you.  It downloads the items from JiuJitsuProGear.com and cleans them up.  You can sort and filter the items to find the one you want.  It even saves your affiliate id for you.  The first time it loads it does take some time to download the items and create the appropriate files.  You must have read/Write privileges to your Windows Live Writer plug-in directory.

If you like my plug-in please Donate $1 to help me keep creating cool stuff like that. Donate to www.whatifoundout.com

If you need help or have feed back I will respond to this post.

To Install:

  1. Download and unzip the plug-in into your Windows Live Writer Plugin file.
  2. Open Windows Live Writer and try it.  It will take a minute to load the first time.

Download it: JiuJitsuProGear Affiliate Plugin for Windows Live Writer


Windows Live Plug-in for Amazon Quick Linker – Download

In my previous post Creating a Windows Live Writer Plug-In with C# I created a plug-in for the Amazon Quick Linker.  I didn’t include the plug-in it self.  I thought It would be better to have a smaller post showing it and the download.  So here is a quick tour or FAQ on it.  Please feel free to post your questions and suggestion on this post.  I really would like to hear back from you.

Download Amazon Quick Linker Plug-in for Windows Live Writer


  1. Close Windows Live Writer it isn’t already.
  2. Unzip the AmazonQuickLink.zip file into your “C:\Program Files\Windows Live\Writer\Plugins” directory.
  3. Open Windows Live Writer and check for the lighting icon on the bottom right menu labeled “Insert”.


Please note, you need to have the Amazon Quick Linker Widget installed to use this.  In my post WordPress, Windows Live Writer, and Amazon Quick Linker I talk about how I got Amazon Quick Linker working with WordPress.

Creating a Windows Live Writer Plug-in using C# Part 2

First we will start off with the Plug-in class that inherits from ContentSource.  Please note from Part 1 that “InsertForm” is a class we will create.


   1: using System;

   2: using System.Collections.Generic;

   3: using System.Linq;

   4: using System.Text;

   5: using WindowsLive.Writer.Api;

   6: using System.Windows.Forms;


   8: namespace AmazonQuickLinkPlugin

   9: {

  10:     [WriterPlugin(

  11:         "93DD80D7-9327-4375-A9D8-777C0549C1C8", 

  12:         "Amazon Quick Link", 

  13:         PublisherUrl="http://www.whatifoundout.com",

  14:         Description="Creates a Amazon Quick Link url",

  15:         ImagePath="Images.Shazam.png")]


  17:     [InsertableContentSource("Amazon Quick Link")]

  18:     public class Plugin : ContentSource

  19:     {

  20:         public override DialogResult CreateContent(IWin32Window dialogOwner, ref string content)

  21:         {

  22:             using (InsertForm form = new InsertForm())

  23:             {

  24:                 DialogResult result = form.ShowDialog();

  25:                 if (result == DialogResult.OK)

  26:                     content = form.Link;


  28:                 return result;

  29:             }


  31:         }

  32:     }

  33: }

Now that we have the basics lets create the “InsertForm” form.  First a capture of what I made it look like and then the code.


   1: using System;

   2: using System.Collections.Generic;

   3: using System.ComponentModel;

   4: using System.Data;

   5: using System.Drawing;

   6: using System.Linq;

   7: using System.Text;

   8: using System.Windows.Forms;


  10: namespace AmazonQuickLinkPlugin

  11: {

  12:     public partial class InsertForm : Form

  13:     {

  14:         public string ASIN { get; set; }

  15:         public string Category { get; set; }

  16:         public string SearchTerm { get; set; }

  17:         public string InnerText { get; set; }

  18:         public string Link { get; set; }


  20:         public InsertForm()

  21:         {

  22:             InitializeComponent();

  23:         }


  25:         private void btnOK_Click(object sender, EventArgs e)

  26:         {

  27:             AssignProperties();

  28:             this.Link = CreateAmazonQuickLink();

  29:             this.DialogResult = DialogResult.OK;

  30:             Close();

  31:         }


  33:         private void btnCancel_Click(object sender, EventArgs e)

  34:         {

  35:             this.DialogResult = DialogResult.Cancel;

  36:             Close();

  37:         }


  39:         private void AssignProperties()

  40:         {

  41:             //TODO: Add validation of ASIN format

  42:             this.ASIN = txtASIN.Text.Trim();

  43:             //TODO: Get categories from Amazon

  44:             this.Category = txtCategory.Text.Trim();

  45:             this.SearchTerm = txtSearchTerm.Text.Trim();

  46:             this.InnerText = txtInnerText.Text.Trim();

  47:         }


  49:         private void btnPreview_Click(object sender, EventArgs e)

  50:         {

  51:             AssignProperties();

  52:             txtPreview.Text = CreateAmazonQuickLink();

  53:         }


  55:         private string CreateAmazonQuickLink()

  56:         {

  57:             StringBuilder s = new StringBuilder();

  58:             s.Append("<a type=\"amzn\" ");


  60:             if (ASIN != string.Empty)

  61:                 s.Append("asin=\"").Append(ASIN).Append("\" ");

  62:             else

  63:             {

  64:                 if (SearchTerm != string.Empty)

  65:                 {

  66:                     s.Append("search=\"").Append(SearchTerm).Append("\"");

  67:                     if (Category != string.Empty)

  68:                         s.Append("category=\"").Append(Category).Append("\"");

  69:                 }

  70:                 else

  71:                     return string.Empty;

  72:             }


  74:             s.Append(">").Append(InnerText).Append("</a>");


  76:             return s.ToString();

  77:         }


  79:     }

  80: }

I’ve added a few TODO’s but for the most part it is done and works great.  One other thing I might note.  I never did get the XCOPY command they give you in the documentation to work after the first compile.  I had to keep deleting the DLL I created in the WindowsLive Writer plug-in directory.

Here is the Amazon Quick Linker plug-in in action.  Let me recommend one of my favorite books on estimation.  Steve McConnell just knows how to put it in a way I understand.  When I read his book Software Estimation: Demystifying the Black Art (Best Practices (Microsoft)) it really opened my eyes and made my programming more enjoyable.  I hope it will do the same for you.

Creating a Windows Live Writer Plug-in using C# Part 1

There are a few example out there already for ContentSource but after trying to use them I found some glaring omissions.  For instance, two of the examples I looked at use InsertForm.  I just assumed that because we were using the namespace System.Windows.Forms that is where it was coming from.  Because the example were in the 2.0 Framework I thought maybe I was just missing some thing.  So when I got the error “The type or namespace name ‘InsertForm’ could not be found (are you missing a using directive or an assembly reference?)” I assumed it was just a matter of finding the reference I needed.  It was!  But to a class I should and would create.  I also had a hard time with the ImagePath property of the WriterPlugin attribute.  For starters the png file must be 16×16 despite what the documentation says, 20×18 didn’t work.  Also don’t forget to set the Build Action property on the image to Embedded Resource.  Its a minor detail that the documentation has but the examples leave out.  Please don’t go looking for a SDK to download despite what is said in the other example.  The WindowsLive.Writer.Api is in the root directory of WindowsLive Writer.

To Summarize:

  1. Your project will need a Windows Form Class added (Name if “InsertForm.cs” just for the fun of it)
  2. Make sure your image is 16×16.
  3. Make sure you set the Build Action on the image to Embedded Resource.
  4. The WindowsLive.Writer.Api file is found in C:\Program Files\Windows Live\Writer
  5. WindowsLive Writer SDK Documents

In Part 2 of this post I will share the plug-in I create and use it in the post.

eBay Google Base Data Feed – How to Configure and Setup

I wanted to create a Google Base feed for my eBay store.  Sounds simple doesn’t it.  It wasn’t for me so I’m going to share how I did it.

  1. In your eBay account go to Marketing Tools.  This is on the left side about mid way down.
  2. Pick the “Make a file of your Store inventory listings available” and click apply.   Note the URL supplied here.  You will use it in setting up your data feed.
  3. Go to Google Base and Register a Google-base xml data feed file with the name: yourstorename.xml
  4. Click on the "Settings" tab;
  5. Under "Website URL (Optional)", replace the existing URL with your store’s XML link generated by eBay.
  6. Click the "Data feeds" link on your "My Items" tab;
  7. Edit your "schedule" beside your "data feed";
  8. Under "URL of file," replace the existing URL with the eBay generated link.  Click "Update Schedule" to confirm your changes;

This should do it.  It won’t happen all at once.  Google Base takes some time to process the file and it won’t get it until your scheduled time.  You can test it all out with a manual upload.

  1. Right click on the eBay generated URL in your eBay account and choose “Save link as”.  It will give you the file to save.
  2. Choose the “Manual: File Upload” that was below the “Schedule”.  Pick where you downloaded the file to and it will be uploaded.

Wait a while and see if it processed.

Amazon Categories or Search Index Matrix

How do I find the Amazon categories or Search Index Matrix?  That was a real devil of a question to solve!  I didn’t find any helpful links, only dead ends.  On top of it all I had no idea they were called Search Indexes.  Lets not also leave out the fact that they vary depending on locations in the world.  Here is where I found them: Search Index and ItemSearch Parameter CombinationsYou will need to expand the tree “API Reference” –> “Search Index and ItemSearch Parameter Combinations” .  Does anyone reading this most not have to retrieve them programmatically?

Adding a PayPal Donate Button with HTML in ASP.Net

How do I add a PayPal donate button to my ASP.Net website with what PayPal generates for me?  After looking through Google I came up with my own easy solution.  It only involves HTML too!  Here it is and then I’ll explain it.

<a id="paypalDonate" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=4381882"><img border="0" id="payPalImage" src="https://www.paypal.com/en_US/i/btn/btn_donateCC_LG.gif" alt="Donate to ASINLookUp.com" /></a>

First of all, create a anchor tag.  In the herf property of the anchor tag past the code from the “E-MAIL” tab where you generated the button from PayPal.  Next inside the anchor tag place a image tag.  Set its border to 0.  This gets ride of the outline around it.  Then in the source property add the GIF used to display the button from the “WEBSITE” tab where you generated the button from PayPal.

Last, set the style of “Text-Decoration: none” on your anchor link.  I did mine in a CSS but you can do yours in the tag if you want.  This gets rid of the underline you see with a link.

I hope this helped as there were may confusing ways to do it out there and some rather complicated, I thought.  See my PayPal Donate button in action by going to: AsinLookUp.com

Configuring Database Mail in Sql Server 2005

I want to send a e-mail using msdb.dbo.sp_send_dbmail but I don’t know how to configure Sql Server 2005 so that it will work.  That was my delimma.  Oh, I googled it.  But everything I read said “Click on Management and then click on Database Mail and follow the wizard.”  For those of us coming from a Oracle background that was a little vague.  The trouble was the answer was right in front of my face.  Microsoft Sql Server Management Studio has a view called Object Explorer.  It is the tree window on the right by default when Management Studio opens.  Towards the bottom there is a node labeled “Management”.  Well, what do you know.  I opened it and found Database Mail.  I walked through the wizard and set up my SMTP server.  I did the test offered by right clicking on Database Mail but no test e-mail came to my configured account.  I realized I had the wrong password and tried again.  No, luck.  It then occured to me that the wizard wasn’t updating the profile.  I deleted the profile put it in correctly and it worked.  Oh, and I have forgot to mention I had to use the Surface Area Configuration application to enable Database Mail.  Once that was all done.  I could look at the log of what was happening by right clicking on Database Mail and I could write queries on msdb like these to check how things were going include what was sent:

SELECT * FROM msdb.dbo.sysmail_allitems order by mailitem_id desc;

SELECT * FROM msdb.dbo.sysmail_event_log WHERE mailitem_id = 4 ;

It was frustating not finding the information I needed and being blind to the obvious.  I hope this helps other avoid my mistakes.  I’d be glad to answer any question if you will comment on the post.