Is the tree green?

The internets are serious business. When you’ve got questions, they’ve got answers… Is Lost on TV? Is it a rerun? What year is it? 2009? 2010? Has the LHC destroyed the world yet? Is Abe Vigoda still alive? Is it MFBT?

Which brings us to the question frequently asked by Mozilla developers. Is the tree green? Ta-da:

Some random factoids about isthetreegreen.com

  • It’s using a cross-site XMLHttpRequest to fetch the tree status from Tinderbox. This is a neat way to generate the answer in the browser (instead of scraping the status from a cron script on my webserver), but it means you’ll need a recent browser (like Firefox 3.1!) which supports this.
  • It’s surprisingly snappy. The HTML is about 7K, and the XHR status is about 2K. Compare that to the normal Tinderbox page, which weighs in around 220K.
  • The page polls the Tinderbox status every 2 minutes and updates the displayed status. The first time the state transitions from not-green to green, it will trigger an alert(). I think this will be rather useful if you’re waiting for the tree to turn green before checking in a patch.
  • It doesn’t check if the tree is open or closed. (Yet?)

Thanks to Jesse for the original idea, and to Reed for helping to get the Tinderbox server configured to allow XS-XHR.

Advertisements

12 thoughts on “Is the tree green?”

  1. Dolske, if you recall me saying I had a brilliant idea a month or two back when I was still sitting in the center of the office sort of across from you (also that I wasn’t stupid enough to tell you what it was 😉 ), this was essentially the idea I had. I think mine was actually for isthetreeopen dot com (but it would have done the all-green check in addition to the not-closed check), but I also planned to buy up the predictable synonyms and antonyms at the same time. (Seriously, you should do that.) If I ever got around to actually making any of this happen, that is, which arguably I might not ever have done (or I might have just parked the domains but not actually made them functional for a long time afterward). 🙂

  2. Looks like I should note that this doesn’t work on Firefox 3.0 (unless there’s something weird about my computer) as it does not support cross-domain XMLHttpRequests as noted by the error I received: “Your browser doesn’t support cross-domain XMLHttpRequests. :-(“

  3. I don’t follow the tree as much so I don’t know if it would change so much as to be ridiculous, but is there anywhere that there is an RSS feed Tree status?
    If not, the feature that comes to mind when I view this very simple page, is to add an RSS feed that puts out an entry every time the status changes.

Comments are closed.