Show me the code! – By Davanum Srinivas

August 31, 2008

[ubiquity] Daily dose of dilbert

Filed under: Uncategorized — Davanum Srinivas @ 9:21 pm

CmdUtils.CreateCommand({
  name: "dilbert",
  description: "Displays the latest dilbert comic.",

  preview: function( pblock ) {
    jQuery.get( 'http://dilbert.com/', null, function( page ) {
      pblock.innerHTML = '<img src="http://dilbert.com/' + page.match(/dyn\/str_strip\/\S*\.gif/i) + '" style="max-width: 480px;" />';
    });
  },
  execute: function() {
    Utils.openUrlInBrowser('http://dilbert.com/');
  }
})

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: