2017 © Pedro Peláez
 

library yahoo-stock-quotes

Quick and dirty Yahoo stock quotes in PHP

image

aensley/yahoo-stock-quotes

Quick and dirty Yahoo stock quotes in PHP

  • Thursday, April 21, 2016
  • by awensley
  • Repository
  • 1 Watchers
  • 0 Stars
  • 3 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

YahooStockQuotes

Yahoo Stock Quotes in PHP, (*1)

MIT License Build Status HHVM Test Status GitHub Issues GitHub Downloads Packagist Downloads, (*2)

Code Climate Grade Code Climate Issues Codacy Grade SensioLabsInsight, (*3)

Code Climate Test Coverage Codacy Test Coverage Codecov.io Test Coverage Coveralls Test Coverage, (*4)

What it does

This library makes it simple to access any number of stock prices (and their changes) in your code. It limits itself to one update per day to save your server's (and Yahoo's) resources. It consists of one code file and one cache file. No database necessary., (*5)

Merely pass an array of your desired stocks' symbols to the YahooStockQuotes constructor and use the three public functions where you need them., (*6)

Simple., (*7)

Requirements

There must be a YahooStockQuotes.json file in the same directory as the YahooStockQuotes.php file., (*8)

YahooStockQuotes.json must be WRITABLE by the user who owns the PHP process (apache, www-data, nginx, hhvm, etc.)., (*9)

If the file does not exist or is not writable, every page view will require a new request to Yahoo's servers, which will slow down all page views drastically and get your server blocked by Yahoo., (*10)

Example usage

<html>
    <head>
        <title>Stock Test</title>
    </head>
    <body>
        Price: <?php echo $stockQuotes->getPrice('YHOO'); ?>
        <br/>
        Change: <?php echo $stockQuotes->getChange('YHOO'); ?>
        <br/>
        Last updated: <?php echo $stockQuotes->getUpdatedDate(); ?>
    </body>
</html>

Supercharged by ZenHub.io, (*11)

The Versions

21/04 2016

dev-master

9999999-dev https://github.com/aensley/YahooStockQuotes/

Quick and dirty Yahoo stock quotes in PHP

  Sources   Download

MIT

The Requires

  • php >=5.5.0

 

The Development Requires

yahoo stock yahoo-api yahoo-finance stockquotes