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

76 Responses to “Stock Quote Tooltip”


  1. 1 George

    I try installing this and I get an error message when I get into the option screen for the stock quote tt. here is the error.

    Fatal error: Cannot redeclare sqtt_the_content() (previously declared in /home/host/public_html/blog/wp-content/plugins/StockQuoteToolTip/StockQuoteTT.php:35) in /home/host/public_html/blog/wp-content/plugins/StockQuoteToolTip/StockQuoteTT.php on line 35

  2. 2 George

    I went ahead and try to see if it still works and the problem I get is it creates the link but is not generating the tooltip.

  3. 3 George

    Ok it was my mistake. I changed the name of the sqtt folder to something else. I changed it back its working now.

    Still getting the error in the options page.
    Fatal error: Cannot redeclare sqtt_the_content() (previously declared in /home/host/public_html/blog/wp-content/plugins/sqtt/StockQuoteTT.php:35) in /home/host/public_html/blog/wp-content/plugins/sqtt/StockQuoteTT.php on line 35

  4. 4 George

    I am gonna try to add some other fuctions like not having the link show more than one time for the same stock and a way to disable the links from showing.

    Another problem I will see if I can address is the force link in a link. For example Google doesnt go to the google site but instead it breaks the link to showing the tooltip like this “google.com”>Google

    This is really cool.

  5. 5 Andy@Hillhome.org - Andrew Hill » WordPress Plugins

    [...] Stock Quote Tooltip [...]

  6. 6 nick.pye

    hi,

    I’ve just installed & get this error
    Fatal error: Cannot redeclare sqtt_the_content() in /var/www/wordpress/wp-content/plugins/sqtt/StockQuoteTT.php on line 35

    the folder is as default sqtt ??

    please advise

  7. 7 Ivan

    I’ve just installed it & got the same problem as the previous guys had:

    Fatal error: Cannot redeclare sqtt_the_content() (previously declared in /www/blog/www/htdocs/wordpress/wp-content/plugins/sqtt/StockQuoteTT.php:35) in /www/blog/www/htdocs/wordpress/wp-content/plugins/sqtt/StockQuoteTT.php on line 46

    Help, please.

  8. 8 Andy

    The above problems with “cannot redeclare…” should be fixed in 0.4 - this was due to an error in how the plugin was registering with WordPress. Please give me feedback on how this works for you.

    Andy

  9. 9 James Burke

    Great plugin! One small thing. The plugin isn’t XHTML 1.0 Strict compliant; to easily make it compliant, remove the language=”..” references from StockQuoteTT.php

  10. 10 Mike O'Brien

    Question,

    Trying to load this into my Wordpress 2.0 installation, the options menu, etc. loads fine.

    I’m probably missing this, but where is the code to place the ticker in my sidebar?

    Thanks.

  11. 11 Mike O'Brien

    Ah, found it on another page - thanks!

  12. 12 Pete

    I’m not sure sure the problem was corrected in 0.4. I have recieved the same error:

    Fatal error: Cannot redeclare sqtt_the_content() (previously declared in c:\wwwroot-80\wordpress\wp-content\plugins\sqtt\StockQuoteTT.php:35) in c:\wwwroot-80\wordpress\wp-content\plugins\sqtt\StockQuoteTT.php on line 35

  13. 13 RUok

    What would be super cool is if you could do something like “sqtt:AAPL” in your post and it created the link. On financial blogs a lot of traders talk in symbols, so there is no need to use the company name. Also, day traders tend to work with a lot of symbols, so having to create the mapping in the options page can be a pain. Awsome plugin though!

  14. 14 Nico

    I like your stock plugin but i still have some suggestions. why dont you try to include european stocks as well? sure, the european blue-chips work but there are a few sites who you could use to check for quote & intraday chart.

    i suggest: http://www.wallstreet-online.de

    have fun and keep on working on your great plugin!
    Nico

  15. 15 DH

    I get the following “Warnings” when viewing a post:

    Warning: preg_replace(): Unknown modifier ‘3′ in /home2/leuthcom/public_html/wp-content/plugins/sqtt/StockQuoteTT.php on line 44

    Warning: preg_replace(): Unknown modifier ‘F’ in /home2/leuthcom/public_html/wp-content/plugins/sqtt/StockQuoteTT.php on line 44

    Warning: preg_replace(): Unknown modifier ‘H’ in /home2/leuthcom/public_html/wp-content/plugins/sqtt/StockQuoteTT.php on line 44

    Warning: preg_replace(): Unknown modifier ‘M’ in /home2/leuthcom/public_html/wp-content/plugins/sqtt/StockQuoteTT.php on line 44

    Warning: preg_replace(): Unknown modifier ‘)’ in /home2/leuthcom/public_html/wp-content/plugins/sqtt/StockQuoteTT.php on line 44

    Warning: preg_replace(): Unknown modifier ‘I’ in /home2/leuthcom/public_html/wp-content/plugins/sqtt/StockQuoteTT.php on line 44

    Warning: preg_replace(): Unknown modifier ‘O’ in /home2/leuthcom/public_html/wp-content/plugins/sqtt/StockQuoteTT.php on line 44

    Warning: preg_replace(): Unknown modifier ‘G’ in /home2/leuthcom/public_html/wp-content/plugins/sqtt/StockQuoteTT.php on line 44

    Warning: preg_replace(): Unknown modifier ‘2′ in /home2/leuthcom/public_html/wp-content/plugins/sqtt/StockQuoteTT.php on line 44

    The tool tips still work and pull in the chart and data, I just can’t get rid of these warnings.

    any help?

  16. 16 DH

    The problem was in the stock names, there were special chars such as:
    (),&’

  17. 17 Amit

    Hi, I installed and activated the plugin without a problem, however the link does not have the tooltip hover above it. Am I missing something obvious here? nice plugin!

  18. 18 Amit

    Sorry, to clarify, the tooltip doesn’t seem to work in Safari on my site. However it does work in safari on your site. And it does work with firefox on my site though. Probably just something with my browser.

  19. 19 michael briney

    I’m excited to try this on our site but…what is the code I need to place the ticker in my sidebar?

    thanks…!

    m

  20. 20 raj

    I’ve installed and activated both stock plugins (WP2.0) and I get the same “redeclare” problem as the guys above. But I’ll see if I can hack out what’s wrong.

  21. 21 Chris

    DH, or anyone for that matter. I removed the spcial chars from the list of stocks in the plug in but I am still receiving the error msg. Any thoughts?

  22. 22 Chris

    Dude, this is an awesome plug in. No can you do it with Google Finance? =)

  23. 23 Chris W

    Sounds like a great plugin, but I’m bumping into something. I have wordpress 2.something and your plugin is installed. I think it is at least partially working because the add_filter call at the top of StockQuoteTT.php is working. To test, I put an “echo $content;” in there and indeed, my page spit out two of everything.

    However, the javascript that it’s supposed to be writing just isn’t in the page source. I am using Firefox, but I tried it in IE 6 and got the same result.

    Anybody else run into this kind of behavior? By the way, the Stock Chart plugin works fine. Oh, and I’ve tried deactivating other plugins.

  24. 24 Chris W

    In reference to my previous post (#23), the one thing I didn’t try - of course - was using other themese. My problems are all caused by the theme I am using: Orange Crush. It works fine on the default theme.

    Sorry to junk the forum up. I’m sure my pain is rooted in CSS, which I plan to tackle immediately.

  25. 25 Chris

    You would not happen to have a nice long list of stock names/symbols. C’mon, please?!
    =)

  26. 26 Jarrett

    Here’s a few hints and tricks….

    1.) To make it work with any other service other than Yahoo! Finance, open up the *.php file and change the append to whatever page you want it to link to. You can go to Google, Fool, TheStreet, … anywhere.

    2.) If you want to only show ticker symbols, you can put AAPL=>AAPL. I know, it’s silly, but it works. For example, if you would rather write “Microsoft (MSFT)”, then only the MSFT will be recognized. Every subsequent use of Microsoft won’t matter.
    2a.) This may pose a problem with companies such as Cheesecake Factory (CAKE) or Brinker International (EAT), if you also post recipes on your page. It just depends how diverse you are, I guess.

  27. 27 Brennan

    Would would be INCREDIBLE is if users could ‘plug in’ the company names and/or symbols they want the tooltip to come up for, on the options page! think about it…

  28. 28 Don Lapre is a Superstar

    handful of thanks to you,it’ll help and serve lot of ppl to know abt tech lik me.thnks a lot.my wish..

  29. 29 Kate

    Whre can I find out more information about this topic?
    http://www.katesoriginals.com
    katesoriginals.com

  30. 30 Steve

    Works great with Firefox, but with Internet explorer it just hangs on loading… and nothing ever gets loaded.

    Any ideas?

  31. 31 Steve

    Now it works with both browsers, but it only works when I am logged in to the blog. Can I set it up so that it works for users who are not logged in?

  32. 32 Chris G.

    I have a blog set up behind a firewall, requiring proxy authentication for the blog to communicate outside my private network. I have set all of the proxy settings correctly in class-snoopy.php and other plugins use them successfully.

    When using your plugin, when mousing over the name of a company, the tooltip appears, but says “Loading” forever. Any way to get your plugin to point to the proxy settings in class-snoopy.php?

  33. 33 Steve Y.

    I’m having the same problem as Chris G. - it just hand on “Loading.” I’m hosted at GoDaddy so this shouldn’t be a firewall issue. Any ideas? Thanks.

  34. 34 Zi Z

    I install the pugin, but when I try to save change it show the following error:
    “Fatal error: Cannot redeclare sqtt_the_content() (previously declared in C:\Domains\ilighthousegifts.com\wwwroot\wordpress\wp-content\plugins\sqtt\StockQuoteTT.php:35) in C:\Domains\ilighthousegifts.com\wwwroot\wordpress\wp-content\plugins\sqtt\StockQuoteTT.php on line 35

    any help??

  35. 35 Warren

    I’m trying to add your plugin to my blog (antipaucity.com), but I seem to be missing something - is there a chunk of code I need to add to index.php to make it work? Might this be a theme issue?

  36. 36 JONATHAN

    hi there Andrew - I’ve been running your code for some time on http://www.cornwallbusinessforum.org and it works beautifully! Just one question though. The dates on the updates don’t seem to make sense - if you mouse over the exchange rates in the sidebar you’ll see the first entry is always the current date, but the second and third entry’s dates have never changed (even though thier data seems to be up to date and correct)
    Pretty weird - any idea what could be causing this?

    Thanks again for an awesome plugin!

    btw you should check out blogkits.com.

  37. 37 thedead

    Is there away to auto search stock symbols? if not all my symbols are surrounded by a ( and : IE (GOOG:NYSE)

  38. 38 Trader8

    Does anyone have a symbol list they would be willing to share? It would take weeks to type in each symbol and company name.

  39. 39 Jason

    Hi Andy, thanks for the work. One thing I have noticed with my WP template (which is based on the same vanillia mist design as yours), is that when a tool-tip pops up in firefox and is on the right hand side of the post, it will display behind the sidebar, and will be partially blocked. Have you had this problem, or can anyone point out a solution? Thanks again.

  40. 40 Designer Ella

    Ahh, we got the base for our plugins from the same soure, it seems. I found you by searching my error. I’m trying to write a similar plugin, of sorts. (I already wrote one this morning based on it, as well.)

    I’m looking at your code for help and using a piece of it. ;-) I’ll let you know if it works out.

    Jason, in the css for this plugin, for the span or tool tip, whatever, you need to add x-index: 100; or something high like that. :-)

  41. 41 Designer Ella

    Hmm, could you assist me with mine? It’s not working. I think it could really help people out. It’s to replace any text with any text, but it’s specifically designed for accents because those can’t be replaced in PHPMyAdmin. That’s why I’m following your use of an options page, without special characters it could all go in the PHP file.

  42. 42 Designer Ella

    Plus _I_ need it desperately, since moving half my posts, lots have accents anyway, and in titles, have ? instead of é. Lots to physically change.

  43. 43 Designer Ella

    Okay I got my plugin working on its original script, if I set the blog to a different encoding. So now I’m not scraping you. ;-)

    But I’m wondering if you can still help me, because I have your problem of it replacing words in URLs, and they’re broken now. Thanks!

    I guess I’ll go examine your code again, ha ha.

  44. 44 Steve

    I’m having the problem where the tooltip pops up but it just says loading… and never populate. This is a brand new install of WP and the plugin, so I’m not sure what I did wrong. Any ideas?

    Thanks,
    Steve

  45. 45 Steve

    Or, is there a way to make the popup not come up and leave in the code that allows you to click on the symbol and link to the yahoo quote page for that stock? That part works great, it’s only the popup that doesn’t work.

  46. 46 Thale

    Very nice plugin! I plan to add it on my website

  47. 47 Budi S

    very good plugin …
    thx

  48. 48 M. Xavier

    This is a great plugin. It installed without any problems and is used daily. Thanks!

  49. 49 Tim

    Hi -

    Thanks for the plugin…very nice.

    Question: Is there a setting to have to highlight only the first instance of a company name? Right now the company is highlighted on every instance and this might be annoying to some. I saw this mentioned above, but no further discussion of it.

    Thanks again.

  50. 50 Andy

    Great plugin, do you think you can expand both your stock plugin’s to include an option for the user to list their target buy and sell prices? Most financial bloggers set their own buy and sell prices. This would be really useful to people like me looking for an easy way to display a stock quote along with some predictions on their blog.

    Andy

  51. 51 Andy So

    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.

  52. 52 friso

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

  53. 53 World Gambling News

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

  54. 54 Andy

    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.

  55. 55 friso

    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!

  56. 56 Vicky

    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.

  57. 57 AJ

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

    Neat plugin…wish I could get it to work.

  58. 58 AJ

    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?

  59. 59 Shankar

    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

  60. 60 brant

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

  61. 61 PC

    I keep getting the following error message:

    Cannot load sqtt/StockQuoteTT.php.

    Please help.

  62. 62 jpbeatty

    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.

  63. 63 Corn

    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

  64. 64 AJ

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

  65. 65 marco

    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

  66. 66 Vinod

    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

  67. 67 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

  1. 1 WordPress Plugins for Investment Blogs : A Beautiful Trade
  2. 2 תוספים לוורדפרס 2-3.05.07 : הבלוג של אח”×™ דקר
  3. 3 WP Plugins DB » Blog Archive » StockQuoteTT
  4. 4 Wordpress Plugin: Stock Tooltip
  5. 5 GurusBlog » Blog Archive » Plugins de bolsa para wordpress
  6. 6 Monetizing WordPress Plugins « Lorelle on WordPress
  7. 7 Stock Quote Tooltip » Wordpress Plugins
  8. 8 Monetizing
  9. 9 Top WordPress Plugins For Every Type of Blog! - The Best Blogging Upgrades Available | The Net Fool

Leave a Reply