Monday, October 12, 2009

A blogger gadget for Ironman

So, since my badge is now working, I thought it would be a good idea to add my badge to my blog. It turned out to be fairly simple, and if you are using blogger, you can just reuse my work. All you need to do is
  1. Click "Customize"
  2. Click "Add a Gadget"
  3. Click "Add your own"
  4. enter the URL
  5. Click "ADD BY URL"
  6. Set the background color
  7. Set the name you registered with the Ironman competition
  8. Set the sex of your badge
  9. And, finally, click "Save"
Just for the record, here is the XML used to create the gadget:
<?xml version="1.0" encoding="UTF-8" ?> 
title = "Ironman Perl Gadget"
title_url = ""
height = "80"
author = "Chas. Owens"
author_email = ""
name = "bg"
display_name = "Background Color"
datatype = "string"
required = "true"
name = "ironman-name"
display_name = "Ironman Perl name"
datatype = "string"
required = "true"
name = "ironman-sex"
display_name = "Sex"
datatype = "enum"
required = "true"
<EnumValue value="male" display_value="Male"/>
<EnumValue value="female" display_value="Female"/>

<Content type="html">
<script type="text/javascript">
var prefs = new _IG_Prefs();
var name = prefs.getString("ironman-name");
var sex = prefs.getString("ironman-sex");
var color = prefs.getString("bg");
var html = '<div align="center" style="background-color: ' + color + '"><img src="' + sex + '/' + name + '.png" alt="Ironman Perl badge for ' + name + '"></div>'


No comments:

Post a Comment

Some limited HTML markup is allowed by blogger: strong, b, i, and a. You may also use em, but I have repurposed it through the magic of CSS to be behave very much like <tt><code></code></tt>.