Created
August 22, 2010 16:38
-
-
Save rtanglao/543966 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html lang="en"> | |
| <body> | |
| <ol> | |
| <div class="container"> | |
| <div class="stuff"></div> | |
| </div> | |
| </ol> | |
| <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" ></script> | |
| <script> | |
| (function($){ | |
| $.ajaxSetup({ | |
| cache: false // turn off AJAX caching so you actually get the top 5! | |
| }); | |
| function doIt(){ | |
| $('.container').empty(); | |
| $.getJSON("http://api.getsatisfaction.com/products/mozilla_thunderbird/topics.json?sort=recently_active&limit=5&callback=?", | |
| function(gsjs){ //gsjs is the JSON object from getsatisfaction | |
| $('.container').append("<li><a href=\""+gsjs.data[0].at_sfn + "\">"+ gsjs.data[0].subject + "</a></li>"); | |
| $('.container').append("<li><a href=\""+gsjs.data[1].at_sfn + "\">"+ gsjs.data[1].subject + "</a></li>"); | |
| $('.container').append("<li><a href=\""+gsjs.data[2].at_sfn + "\">"+ gsjs.data[2].subject + "</a></li>"); | |
| $('.container').append("<li><a href=\""+gsjs.data[3].at_sfn + "\">"+ gsjs.data[3].subject + "</a></li>"); | |
| $('.container').append("<li><a href=\""+gsjs.data[4].at_sfn + "\">"+ gsjs.data[4].subject + "</a></li>"); | |
| }); | |
| setTimeout(doIt, 32000); | |
| }; | |
| setTimeout(doIt, 1000); | |
| })(jQuery); | |
| </script> | |
| </body> | |
| </html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment