Ubiquity Tutorial: How to Write a Simple BSE Sensex Tracker

Ubiquity is a new Firefox plugin that can be used as a command line for creating simple Web mashups. What follows is a simple tutorial on how to write a new Ubiquity command (let’s call our command ’sensex’) that displays the current BSE Sensex chart inside any website in Firefox.

To get started, install Ubiquity, press CTRL+Space, and enter the command "command-editor".

ubiquity-command

Then copy and paste this code in the text editor – the command is automatically saved as you type and you may start using the command with restarting Firefox.

CmdUtils.CreateCommand({
  // The name of the Ubiquity command - this is what you would type to invoke the command.
  name: "sensex",

  // The description of the command.
  description: "BSE Sensex charts.",

  // The preview display - since we only need to view the graph (and nothing else).
  preview: function (html) {
    // Take the graph from the bseindia.com site, and insert it into the Ubiquity preview window.
    html.innerHTML = '<img style="width: 490px; height: 240px;" src="http://www.bseindia.com/images/line_graphs_zoom.png"/>';
  }
});

Press Ctrl+Space again and type "sensex" – There you have the live sensex chart accessible from just about any other website.

bbc command

Find this article at: http://www.labnol.org/internet/tools/ubiquity-tutorial-write-sensex-tracker-command/4752/

web: http://www.labnol.org/ email: amit@labnol.org


Reader Comments

how about for individual scrips of NSE?

Excellent work. I will try and crack this for Nifty also.

If you have a question or suggestion that is not related to the above discussion, please post it in this forum. All comments are moderated.

Add a Comment

required, use real name
required, will not be published
optional, your blog address

« Back to main

Google Custom Search