Skip to content

Instantly share code, notes, and snippets.

@loicbertron
Last active August 29, 2015 14:04
Show Gist options
  • Save loicbertron/c63cb6fc02bc62e73244 to your computer and use it in GitHub Desktop.
Save loicbertron/c63cb6fc02bc62e73244 to your computer and use it in GitHub Desktop.
function showthemess()
{
$.ajax({
type: 'GET',
url: '/tweets/'+ id,
data: {'last_tweet' : lasttweet},
success: function(data){
lasttweet = data.last_tweet;
$(function () {
$("#tweetspanel")
.renderTweets({
tweets: data.tweets,
template: Handlebars.compile($('#tweets-template').html())
});
});
}
});
}
$(document).ready(function()
{
var refreshId = setInterval( function()
{
showthemess();
$("#tweetspanel").renderTweets('refresh');
}, 5000);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment