My Time with Yahoo! Widgets

For a year, I was REALLY into making widgets. I’d would still be making them if they ever fixed the bugs I reported and got the performance of the widget engine better.

My self-hosted homepage for my widgets was here, while my approved widgets are hosted on the official site. There is one secret widget I made that isn’t really hosted anywhere, and that’s my cockroach simulator. That was one of my favorite widgets. It hogged my CPU, but it was worth it to see a cockroach scurrying around my screen.  My most popular script was probably Doom mooD.

I know it’s been mentioned by Dwight Silverman twice before, and I still haven’t found anything that’s even close to the combined whimsy and functionality. When you add in the nostalgia factor, I don’t think anything can match up to it.

From programming widgets, I learned about XML and javascript. I got into some of the heavy object orientated side of javascript, and even started making libraries for other widget makers. I also started making Photoshop scripts to help automate taking my Photoshop designs into the XML layouts for the Yahoo! Widget Engine.

July 21st, 2009 | Mental Note: Add Category | No comments

Using XPath to find email address links

I wanted to write a Greasemonkey script to modify all mailto: links on a page, but to do that, I have to find them first.

Here’s my first attempt:

//a[@href]/text()[contains(.,"@")]

It’s pretty bad. I wanted to find links starting with “mailto:” but couldn’t figure out how to operate on the href attribute.

second attempt:

//a/@href[contains(.,"mailto:")]/..

Here you can see that I managed to operate on the href attribute, and then back back up to the a node. I learned how to select the attribute, instead of using the attribute to select the node.

third attempt:

//a[contains(@href,"mailto:")]

Simplified even further!

fourth attempt:

//a[starts-with(@href,"mailto:")]

I knew there was a starts with function… I just had to look it up.

February 11th, 2009 | Neato!, Nerd | No comments