Archive for the ‘Mac OSX’ Category

TPG Usage Widget for OS X

Saturday, May 17th, 2008

Update: Make sure you get the latest version of the widget!

Since I’ve hit my bandwidth limit with TPG this month, I figured a Mac OS X dashboard widget would be a good way of keeping tabs on my usage in future. The only one already available didn’t work for me, so I made my own.

TPG Widget - Front

 

TPG Widget - Back

It’s pretty simple it shows your choice peak usage, offpeak, both or both combined and you can set your bandwidth limits.

 

Download TPG Usage Widget (version 1.2, 88kb zip)

I’m not sure how frequently TPG update their Your Account area with bandwidth information, but this is where the widget gets the data from.

Resources I found useful for this:

  • Dashcode – the first time I’ve used an IDE. It wasn’t bad once I stopped typing vim commands, but there’s still a little bit of “magic” that’s hidden from you
  • Mostly existing widgets. It’s all just JavaScript, HTML, CSS under the hood. Right-click any widget and do “Show Package Contents”
  • A very introductory tutorial
  • The Flip Side – Some useful tutorials, just search

The biggest gotcha for this app was allowing network access (under Widget Attributes in dashcode, or in Info.plist). It turns out if you make an XMLHttpRequest with this disabled, the request doesn’t happen (obviously), but no error is thrown and you just get an empty string for responseText

Update 1/06/08: Updated the widget to fix some very minor bugs, and adding usage expiry date information, as requested by a few people.

Update 22/06/08: Update to improve the indicator values and fixed minor expiry days countdown bug

Update 27/07/08: Update 1.4 to fix a major bug