jquery-stockquotes
Usage
Twitter: <span class="stock-quote" data-symbol="TWTR"></span>
Facebook: <span class="stock-quote" data-symbol="FB"></span>
Google: <span class="stock-quote" data-symbol="GOOGL"></span>
Netflix: <span class="stock-quote" data-symbol="NTFLX"></span>
Yahoo: <span class="stock-quote" data-symbol="YHOO"></span>
$('.stock-quote').stockQuotes();
Installation
Add the package via bower
bower install jquery-stockquotes --save
Link the resources
<link rel="stylesheet" type="text/css" href="/bower_components/jquery-stockquotes/dist/jquery.stockquotes.css" />
<script type="text/javascript" src="/bower_components/jquery-stockquotes/dist/jquery.stockquotes.js"></script>
Options
$('.stock-quote').stockQuotes({
changeClass: 'change', // css class for change arrow
quoteClass: 'quote', // css class for quote
precision: 2, // decimal precision of change
includeSymbol: true // if the symbol should be added to the output
});
Todo
- configure additional display items (mkt cap, etc)
- explore another API, as the current on rate-limits
- unit tests