Skip to content

Instantly share code, notes, and snippets.

@AurumProject
Forked from anonymous/index.html
Last active August 29, 2015 14:14
Show Gist options
  • Save AurumProject/6c0031360edc109ee159 to your computer and use it in GitHub Desktop.
Save AurumProject/6c0031360edc109ee159 to your computer and use it in GitHub Desktop.
<div class="stockTick"></div>
<div class="symbolname"></div>
<div class="symbolreloco"></div>
var gstock = ["INDEXTSI:OSPTX", "PPY:000001"];
$(document).ready(function () {
for (var i = 0; i < gstock.length; i++) {
$.getJSON("https://finance.google.com/finance/info?client=ig&q="+gstock[i]+"&callback=?", function (response) {
var stockInfo = response[0];
var stockString = '<div class="stockWrapper">STOCK:';
var stockName = stockInfo.t;
var syss = stockInfo.c;
stockString += '<div class="symbolname"> ' + stockInfo.t + ' </span>';
stockString += '<span class="stockPrice">' + stockInfo.l + '</span>';
stockString += '<span class="stockChange">' + stockInfo.c + '</span>';
stockString += '<span>at</span> <span class="stockTime">' + stockInfo.ltt + '</span>';
stockString += '</div>';
$('.stockTick').append(stockString);
$('.symbolname').append(syss);
$('.symbolreloco').append(stockName);
});
}
});
.stockWrapper {
display: block;
padding: 20px;
font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
font-weight: 300;
}
.stockSymbol {
font-weight: 600;
}
.stockPrice {
font-weight: 600;
color: red;
}
.stockChange {
font-weight: 600;
color: green;
}
.stockTime {
font-weight: 600;
color: grey;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment