Recent Comments
Interesting to find that out, wouldn't have expected it to be a problem. I've had similar...
Creating A Recent Comments Widget With Disqus's API and PHP good code pls try
Glad it helped!
Superb and very informative for me,,,
I am new guy for this PHP. i get it clear idea about your topic.All the points are explained...
If you want to put the number of posts in a different area than the recent comments section...
no, straight php.
It depends, are you using wordpress or joomla? I have a different plugin that checks disqus for...
very cool... it works! Do you know if it is possible to include number of total post likes on...
Hmm...It would probably help if I post a comment on my site so people can actually see my...
| Using jQuery and Google Finance to Create a Simple Stock Ticker |
Posted: November 17th, 2011 - I needed to create a simple stock ticker for my company's intranet portal a few days ago. I found some information on stackoverflow suggesting that you could make an ajax call to Goggle Finance and get a JSON response. I hooked it up and it works perfectly. Here is the complete code first $(document).ready(function() { $.getJSON('https://finance.google.com/finance/info?client=ig&q=NYSE:AIR&callback=?', function(response){ var stockInfo = response[0]; var stockString = '<div class="stockWrapper">STOCK:'; stockString += '<span class="stockSymbol">'+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').prepend(stockString); }); }); It's pretty simple right? Put the above code in a script tag in your page header. Just change the NYSE:AIR part in the request string to YourExchange:YourSymbol. Also, remember to put a div on the the page with css class stockTick. |
Latest Posts
- Is Your CFLOOP Hogging Memory or Causing OutOfMemory Errors? - Posted January 13, 2012
- If PHP's file_get_contents Function is Failing With IIS 7 - Posted November 28, 2011
- Using jQuery and Google Finance to Create a Simple Stock Ticker - Posted November 17, 2011
- Adding a custom Prefix or Suffix to YOURLS Short URLs - Posted November 15, 2011
- Creating A Recent Comments Widget With Disqus's API and PHP - Posted November 9, 2011
