Tag Archives: xml

Life=Boring Mental Note: Add Category Portfolio

Announcing allbfcards.com

So I’ve been playing this game called BattleForge, and there are a handful of websites that exist just to display information about these cards you can collect in the game (think Magic: The Gathering or Pokemon). People have also made Adobe AIR applications and Microsoft Access databases. So, naturally I thought I would pollute the web with another website.

At first, I was going to use xml + xslt to make it. I actually got a proof of concept working nicely. But once I tried using javascript, it got weird on me because it was XML instead of HTML. Then I changed it to plain HTML + an XHR request to get the XML file and got basic realtime filters working. Then someone pointed out that there was some google docs with the information I wanted so I switched from XML to JSONP.

Anyways, this is the limit of my attention span so I’ll paste the URL now. http://allbfcards.com/

Mental Note: Add Category

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.

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.

Neato! Nerd

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.