Inline Stock Quote Plugin

by Ryan Barr on December 29, 2007

in Web Development

Add In-line Stock Quote Data to your Posts. Based on the StockQuoteTT Plug-in by Andrew Hill. I took the framework that Andrew Hill put together and instead of setting up stock quote tool tips, which were driving me nuts based upon my sites design, I pulled in the current data from yahoo.com and placed it in-line.

This is my first Wordpress plug-in, so I welcome any commentary on improvements etc…

  • Version: 0.2
  • Tested on Wordpress versions: 2.3.1, 2.3.2

Usage

To use the plug-in, simply extract the files from the zip and drop it into your plug-ins folder. There is a sample .css file included that you can place into your style-sheet for customization.

After you extract the files and activate the plug-in, it would be best to sneak over to the ‘Options’ section and configure the plug-in. From there, you should be good to go. The plug-in acts as a content filter so you don’t really need to do anything else.

Enjoy!

Change Log

  • 0.1 – Initial Release
  • 0.2 – Enhancements for page load speed and protection against timeout
    • Added support for CURLOPT_CONNECTTIMEOUT parameter via the options control page.
    • Moved query to global function and usage of global variables to reduce the number of queries made to the yahoo engine and speed up page load time.

Download

Version 0.1 – Inline Stock Quote Plugin Version 0.2

Bookmark and Share
  • I'm not a huge PHP guy, but it looks like it has to do with file ownership.

    In the code, the results from yahoo are downloaded to a temporary directory on your server and then used.

    This might work... create a new directory on your server, in a place you 'own'. Then modify the code on line 109 from
    $tmpquotename = tempnam("", "inlinestockquote");
    to
    $tmpquotename = tempnam("/YOURNEWDIRECTORY", "inlinestockquote");

    If that doesn't do the trick, take a look at this post describing what is going on with a different piece of software:
    http://drupal.org/node/182058

    Let me know how that goes. The plugin doesn't 'need' to use a temporary file, so as a last resort that could be removed and the code could be modified.
  • toqueboy
    this seems like a great tool but when i install on 2.3.2 i get all the classic stock plugin errors...perhaps i am doing something wrong?


    Warning: fopen(): SAFE MODE Restriction in effect. The script whose uid is 10020 is not allowed to access /tmp/inlinestockquote8eHnlG owned by uid 48 in /var/www/vhosts/simplesimple.ca/subdomains/secure/httpdocs/wp-content/plugins/inlinequote/InlineQuote.php on line 111

    etc etc

    thoughts? i'd love to use this.
blog comments powered by Disqus