Opera Widget: NSE Ticker

Turns out that there isn’t a single working software that allows you to have a “Stock Ticker” on your desktop that scrolls the latest prices of shares on the National Stock Exchange (of India). Yahoo! Finance and Google Finance provide quotes for queried stocks but not a live feed for all stocks or popular stocks. And the software provided by the NSE (written in VB6) is “broken”  :roll:

How then is the programmer-son supposed to fulfill the software requirement of his father who’s recently started using his online trading account on a regular basis?

The first thing I could think of is UserJS. Dad uses the browser for accessing his online trading account.  Injecting client-side JavaScript into a loaded page and having jQuery load the feed and display it in a marquee.  :wizard:

Two problems with that idea: The page is an HTTPS secure page, and having UserJS run on such pages requires changing settings manually using opera:config. I altered that setting and finished writing JavaScript to load a stock quote from Yahoo! Finance using their API. It didn’t work. I was in for a rude surprise. In my internship interview, I had very confidently spoken about AJAX and the cross-site scripting issue. And now when I was staring at code that “should’ve worked, but didn’t”, I was clueless. Until lightning struck.  :party:

But even if that would’ve worked, including 3rd party code inside a HTTPS page that’s used for something as data-sensitive as online-trading — It’s a bad, bad idea. Even if I had ignored all those grave security concerns and gone ahead with the idea, Opera, quite helpfully — and in this case, annoyingly — asks the user for permission to execute UserJS.  :monkey:

Next, I thought of building a VB .NET program that improved on the software provided by the NSE. But since I already had JavaScript and stuff written for the idea, I was looking to utilize it somewhere.

Lightening struck again. Opera Widgets:yes:

I really believe mainstream desktop applications need a software platform that allows Software Applications to be designed using HTML/CSS/JavaScript + a dynamic language supporting compute-intensive operations + XML/JSON. With a lot of desktop applications moving online, it just “makes sense” to have a web platform for desktops. Not only would it cut down development time considerably, it would nullify the need for languages such as C++ at least for UI design. These platforms do exist currently, including one that supports coding in PHP, but they haven’t caught on yet. Browser-based applications can take full advantage of innovations on the web, and HTML5, and do a wide-variety of things.  8)

The most wonderful thing about Opera Widgets is that it does not require the browser to be running. Widgets can function as standalone applications, and they can take full advantage of webpage rendering capabilities provided by Opera. It’s beautiful.  :headbang:

A lot of issues came up while building this widget — finding a good feed source, customizing and optimizing the data fetched, cross-site scripting — making stuff work and look good at the same time.  :drunk: But none of those issues were related to coding the application itself. The focus was always on solving the problem, rather than worrying too much about memory consumption, file accesses and low-level implementation details — something we commonly find when developing typical desktop applications.

NSETicr is an Opera Widget that displays 50 stocks and their latest prices. Below, are screenshots that show the installation procedure.

I haven’t strictly adhered to the Opera Widget API, so it’s not yet good enough to be submitted to the Widget archive maintained at opera.com. May be soon.  :-)

Requirements: Opera 10.63+

Download Live Demo

This entry was posted in Open Source, Opera Web Browser. Bookmark the permalink.

2 Responses to Opera Widget: NSE Ticker

  1. MoGaMbO says:

    good job… nice prog…. it would be better to let the user enter his own preferred stocks….

  2. Francis Lang says:

    Yes, unable to load my own stocks.. :doh:

Leave a Comment

Your email address will not be published. Required fields are marked *

*

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

:D :lol: :cheers: :cry: :idea: :roll: :evil: :!: :?: :wink: :coffee: :detective: :doh: :faint: :furious: :headbang: :heart: :aww: :angel: :chef: :drunk: :irked: :jester: :knockout: :love: :monkey: :no: :party: :pirate: :rip: :scared: :sing: :waiting: :whistle: :wizard: :worried: :yes: :zzz: :mrgreen: :-| :arrow: 8O :-) :-? 8) :oops: :P :-o :-x :-(