Skip to content

Instantly share code, notes, and snippets.

@rtanglao
Created August 22, 2010 16:38
Show Gist options
  • Select an option

  • Save rtanglao/543966 to your computer and use it in GitHub Desktop.

Select an option

Save rtanglao/543966 to your computer and use it in GitHub Desktop.
<!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