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) 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