This project is based on the BlogQuote project started by Anders Brownworth, who created a standalone JSP application that allowed placement of some HTML code to generate stock quotes in a tooltip. For example:

Novell (NOVL)
Microsoft (MSFT)
Berkshire Hathaway (BRK-B)

I took his work and converted the web service to PHP, while also adding the Wordpress-specific pieces that add the required code on-the-fly. This plugin allows for automatic inclusion of stock quote tooltips when you mouseover a configured company name. The mapping of company names to stock symbols is configured in the WordPress Options tab, under Stock Quote TT. If you are looking for a tabular listing of stock quotes to include in your sidebar, go here.

There are several parts to this plugin:

  • StockQuoteTT.php is the actual plugin that handles the options page, as well as the insertion of the filter to dynamically add the required code around the company names you specify. It also contains some JavaScript code that is dynamically inserted into each page of your blog to handle the calls to the web service, below.
  • sqttGetQuote.php is the XML web service that accepts a stock quote on the query string, and return the information in XML format to the calling application.
  • sqttShowQuote.js contains the rest of the JavaScript code that handles calls to the XML web service, and caching of quotes within the same page for about 100 seconds.
  • sqttQuoteStyle.css is a cascading stylesheet that formats the tooltip and link. Feel free to customize it to your liking.

To install, simply unzip into your WordPress plugins folder, which should result in a folder called sqtt. Enable the plugin, and configure it under the options tab.

This page will contain updates to code, documentation, and bugs.

The plugin has been tested with WordPress 1.5 and 2.x.

This is free software, but donations are accepted in the sidebar.

Download here.

Change Log

Rev Date Description
0.1 2005-10-11 Initial Release
0.2 2005-10-13 Fix for broken links issue. Code will now only be inserted for company names found outside of A tags.
0.3 2005-10-16 Fixes for Internet Explorer
Code is now valid XHTML 1.0 Transitional
0.4 2005-10-21 Fix for redeclare error in Admin pages.
0.5 2007-05-01 Changed from fopen to cURL. This allows the plugin to work on hosts where allow_url_fopen is disabled.
0.6 2007-09-07 Fix for Yahoo Finance URL change
0.7 2007-09-07 Fix the 0.6 version

69 Responses to “Stock Quote Tooltip”


  • Hi Andy,

    It looks like the plug-in on your blog isn’t working. I’ve installed it on my blog and it was working fine for a few days. On your blog and on my own it is saying “The document has moved here”. I guess Yahoo! Finance adjusted the location of the quote server? Could you take a quick look? I publish a load of articles using your plug-in exclusively.

  • yes this plugin worked fine a few days.. now the pop up says only loading… Someone help?

  • I’m have the same problem, has anyone found a fix for this? How is it still working on this site?

  • The issue described in the last few comments has been fixed. Yahoo changed the URL for quote downloads. Download the new 0.6 version above and all should be well.

  • Andy,

    I downloaded 0.6, activated it etc. but now there is not even a pop up… The company names do not turn into blue..

    I will check this website for updates, thnx!

  • I’m sorry, but it doesn’t work on 2.3.2. The page goes blank when I activate the plugin. I see others are having same problem.

  • All I get is a mouseover box that says “loading”.

    Neat plugin…wish I could get it to work.

  • Although the mouseover info box is not working, at least it links the symbol to a Yahoo chart. Now, which file would I change to tell it to bring up a 1-day chart and to open the Yahoo site in another tab/window?

  • Any tweak of the plugin to include it in blogsome blogs….in blogsome there is no option to upload a plugin, though it is wordpress powered blog

  • plug in installed fine. How do I get it o show up? can I put into a widget?

  • I keep getting the following error message:

    Cannot load sqtt/StockQuoteTT.php.

    Please help.

  • Is there a way to simply add this to a regular website, and not a wordpress blog? I’ve been searching high and low for something that I could use on my website to display current indices, and this looks great.

  • Hello, thanks for the great plugin! Everything is working fine however when it pulls up the box the graph and the text are outside the box. How do I fix this? Thanks

  • Anybody ever figure out how to get the “Loading” out of the tooltip?

  • hey that quote chart you have on the top right hand corner where did you get it ? i cant seem to find it anywhere, btw love your script going to install it shortly.

    Thanks

  • Hi,

    I am getting the following error:

    %BEG_OF_TITLE%Stock Quotes%END_OF_TITLE%
    Fatal error: Call to undefined function curl_init() in C:\wamp\www\wordpress\wp-content\plugins\stock-quote-sidebar\stockquote.php on line 402

    How do I fix this? Pls advice. I’m using WP 2.7.

    Thanks
    Vinod

  • Hi,

    I am using this plugin and have added the stock exchange (^BSESN) but it is showing the Stock Exchange name also as ^BSESN which isn’t looking good. Is there anyway I could change it as BSE or BOMBAY STOCK EXCHANGE?

    I am facing same issues for some other stocks as well…

    Pls. advice.

    Thanks
    Vinod

  • Thank you so much for this! It has helped me out immensely! The stock market is incredibly difficult to understand and grasp and the learning curve is steep but once conquered, it can prove to be very profitable. You now have a chance to ‘practice’ trading stock picks at wikinancial.com all for free. Become a part of the community and learn from the best.

  • Is there a way to center the quotes in the sidebar instead of having them shifted to the left? BTW – Great work on this!

Leave a Reply