2013-04-15 80 views
2

我有一個自動化的Twitter飼料在我的網站上,它工作得很好直到最近,我已經找到了它的原因,因爲Api 1.1的變化,我需要進行更改,但我在損失如何解決它!驗證碼:jquery自動化twitter飼料和api 1.1

$(document).ready(function() { 
    $.getJSON('http://search.twitter.com/search.json?rpp=75&callback=?&q=%2y' ,function   (data){ 
    for(var i=0;i<data.results.length;i++){ 
     var tweeter = data.results[i].from_user; 
     var tweetText = data.results[i].text; 
     var tweetText = tweetText.substring(0, 139); 
     tweetText = tweetText.replace(/http:\/\/\S+/g, '<a href="$&" target="_blank">$&</a>'); 
     tweetText = tweetText.replace(/(@)(\w+)/g, ' $1<a href="http://twitter.com/$2" target="_blank">$2</a>'); 
     tweetText = tweetText.replace(/(#)(\w+)/g, ' $1<a href="http://search.twitter.com/search?q=%23$2" target="_blank">$2</a>'); 
      $('#tw').append('<li class="tweet"><div class="tweetImage"><a      href="http://twitter.com/'+tweeter+'" target="_blank"><img src="'+data.results[i].profile_image_url+'" width="48" border="0" /></a></div><div class="tweetBody">'+tweetText+'</div></li>');  
    } 
    }); 

    function autoScroll() { 
var itemHeight = $('#tw li').outerHeight(); 
    /* calculte how much to move the scroller */ 
    var moveFactor = parseInt($('#tw').css('top')) + itemHeight; 
    /* animate the carousel */ 
    $('#tw').animate(
     {'top' : moveFactor}, 'slow', 'linear', function(){ 
      /* put the last item before the first item */ 
      $("#tw li:first").before($("#tw li:last")); 
      /* reset top position */    
      $('#tw').css({'top' : '-6em'}); 
    }); 
    }; 
/* make the carousel scroll automatically when the page loads */ 
var moveScroll = setInterval(autoScroll, 6000); 
}); 

的偉大工程,它拉的鳴叫與hastag jQuery的,但我要的是通過用戶名nnacanada鳴叫,我怎麼能acomplish呢?任何幫助非常感謝!

+0

我認爲,所有你需要做的就是添加「 &screen_name = nnacanada「到您的getJSON調用。 $ .getJSON( 'http://search.twitter.com/search.json?rpp=75&screen_name=nnacanada&callback=?&q=%2y' – carrabino

回答

0

它看起來像是你的URL添加了& user_id或$ screen_name並且它的值正確,它應該可以工作。