Update: Now hosted at http://wordpress.org/extend/plugins/stock-quote-sidebar/ – please rate the plugin there if you like it! This page will still be updated, and comments are welcome here.
This is a WordPress plugin that allows you to put a list of stock quotes in your sidebar (or anywhere you want, really). This should be considered beta software, although I’ve been using it without problems for a while, as you can see in my sidebar. I have a different plugin that allows inline stock quote tooltips – check that out here.
Usage:
Unzip into your WordPress plugins directory, which should result in a directory called sqsidebar. Enable the StockQuoteSB plugin in the Admin page. Configure the plugin under WordPress Options, Stock Quote Sidebar.
Then, wherever you want the quotes to appear, put in code like the following, depending on what quotes you want:
<?php get_stock_quote(); ?>
You can also override the symbols configured in WordPress options by explicitly calling get_stock_quote with the symbols as parameters:
<?php get_stock_quote("NOVL,PFE,INTC"); ?>
The options allow you to specify the following:
- Yahoo URLs to use for quotes and charts
- Chart range (1 day, 5 day, etc)
- Date and time format
- Number of randomly selected quotes to display
- Whether to display the symbol or the company name
A chart is displayed in a tooltip when you mouse-over the day’s change.
As of version 1.2, cURL is used to download quote data. Accordingly, cURL must be available and enabled in your PHP environment.
Version 1.3 fixes the issue caused by Yahoo changing the URL for stock data downloads. Existing users will need to download version 1.3 or later, and change the URLs in the plugin’s options to NOT include the “http://” portion. For example, enter finance.yahoo.com and NOT http://finance.yahoo.com
Versions 1.4 and later use a different plugin directory, due to the way the SVN downloads work from Wordpress.org.
This plugin has been tested with WordPress 1.5 and 2.x.
Please leave feedback or let me know of any problems below.
This is free software, but donations are accepted in the sidebar.
Download here
This is exactly what I was looking for, it’s not easy to find a stock quotes plugin that works. The plugin is working for wordpress 2.8.
I’m currently transforming a friend’s site (technightowl) to use XHTML transitional – I had to make a small change to your code and style-sheet to make it compliant:
You should use ‘class’ instead of ‘id’ for non-unique elements, so i made the following change in the main function:
if( $i%2 != 0 ) {
echo ”;
}
else {
echo ”;
}
and in the style-sheet:
tr.sqsbevenrow {
background-color: #eeeeee;
}
You might want to include that in future updates.
Great app, useful, keeps users informed.
I might try installing this.
Hi Andy, there is problem with quotes with the = token like EURUSD=X. Hope you can fix it.
Cheers!
Hi. I’m from japan.
The method of setting up two plug-ins on one site?
Can this be used to display TSX & TSX Venture quotes? And if so how can I do this? I am in Canada and would really like to use this widget… it looks amazing! Thanks!!
How can I fix the tooltip because it did not show completely (like another part hiding when I drag my cursor more to the right of sidebar). It might be because of body I guess. So can you show me how to fix it?
Great website. Great plugin, is there a way to “rename” stocks? For example, I want to use:
But instead of “Hang Seng Index” I’d like it to just be “Hang Seng” or instead of Gold June 10, just “Gold” or “Oil.”
Thanks, keep up the good work.
appreciate your plugin, and we have a question. any chance you might have an upgrade to allow us to input a beginning date for each stock? …to show the change as of when we began recommending it to our clients.
I had a quick question. When I tried to use your plugin it prints out a full chart for each stock. How did you get your to look like it is on your sidebar? Im also on the newest version of wordpress 2.9.2