Usage:
$(".page .items").autobrowse(
{
url: function (offset)
{
return "http://twitter.com/status/user_timeline/ParisHilton.json?count=10&page=OFFSET&callback=?".replace(/OFFSET/, 1+Math.round(offset/10));
},
template: function (response)
{
var markup='';
for (var i=0; i<response.length; i++)
{
markup += '<div class="tweet">';
markup += '<img src="' + response[i].user.profile_image_url + '" />';
markup += '<p><strong>' + response[i].user.name + '</strong>';
markup += response[i].text;
markup += '</p><div style="clear: both;"></div></div>';
}
return markup;
},
itemsReturned: function (response) { return response.length; },
max: 50,
sensitivity: 100,
finished: function () { $(this).append('<p style="text-align:center">Nothing more to show</p>') }
}
);
Demo: Scroll down for more tweets from Paris Hilton (Clear cache)