The value of saving old code

I spent almost two hours the other day trying to embed a Skype status button into Moodle.

First, I copied the code wrong on Skype’s page for making the button  . It didn’t have the </div> tag at the end. Until I figured that out, I kept thinking it was Moodle not letting me add the Javascript, so I spend time on the Moodle forums trying to figure out how to trick Moodle into allowing it. It was important, for example, to turn off the HTML Editor in my profile.

So then I finally get the button added, and it looks like this:

skypechat

I log into Skype. It looks like that. I log out of Skype. It still looks like that. Why isn’t it indicating my status? I go to Skype’s website again (it made me log in every time I opened a tab and went to the page).

Apparently the “new” button does not indicate your status. I can’t imagine the usefulness of putting a Skype button on your webpage that doesn’t indicate whether you are available or not. But search the support forums and follow the trail and there it is:

noskypestatus

It only works if you have the OLD button? So I start thinking – how do I get the code for the old button? I keep searching around the forums, and found someone had posted some old code that they couldn’t get to work, with a “mystatus.skype.com” URL so I used that as a search in the forums, but no joy. I even tried to reconstruct his sample with my parameters.

Then I remembered – I keep a file with code snippets. I’ve got bits like how to write <object> and html, and the code for making a YouTube video play at a certain spot, and how to zip a folder in ZipIt, and all the other stuff I was afraid I’d forget.

There it was:

<!–
Skype ‘My status’ button
http://www.skype.com/go/skypebuttons
–>

src=”http://download.skype.com/share/skypebuttons/js/skypeCheck.js”&gt;
<a href=”skype:lisalanesoffice?chat”>
<img src=”http://mystatus.skype.com/smallclassic/lisalanesoffice&#8221; style=”border: none;” width=”114″ height=”20″ alt=”My status” /></a>

Plugged it into Moodle, and it worked like a charm.

So don’t throw that old code away – recycle!