I’ve been trying to implement JavaScript thats read my twitter account ant return to me the latest 2 tweeties…
I try to use the XML but, it doesn’t work well.
There is a easy way to do this?
<script>
var ajax = "";
$(function () {
ret_tweets(1);
$('body').data('page', 1);
in_scroll();
});
function in_scroll() {
$(window).scroll(function () {
if (($(window).scrollTop() + $(window).height() + 10) >= $(document).height()) {
$(window).unbind('scroll');
ajax.abort();
ret_tweets($('body').data('page'));
}
});
}
function retorna_tweets(pagina) {
$('#list-tweets').append('<li class="Loading">Loading</li>');
var screen_name = 'new';
var url = 'http://api.twitter.com/1/statuses/user_timeline.json?callback=?';
$('body').data('page', paging + 1);
ajax = $.getJSON(url, {
screen_name: screen_name,
page: page
}, function (tweets) {
$('.carregando').fadeOut(function () {
for (x in tweets)
$('#list-tweets').append('<li>' + tweets[x].text + '</li>');
in_scroll();
$(this).remove();
});
});
}
</script>
There is another solution using JAvaScript?
Try This, should Work:
The JavaScript:
IN C#