ユーザーがランダムな単語を入力し、関連するツイートのリストを取得するWebサイトを開発しています。
リンク、返信、ハッシュタグを含むツイートをjsonで取得するときに除外するにはどうすればよいですか?
これが私のjQueryコードです:
<script>
function go(){
var url = "http://search.twitter.com/search.json?callback=results&q=" + $("#text").val();
$("<script/>").attr("src", url).appendTo("body");
$("#text").remove();
}
$("#text").keydown(function(e){ if( e.which == 13 ) go(); });
function results(r){
window.results = r.results;
window.theIndex = 0;
displayNext();
}
function displayNext(){
if( window.theIndex >= window.results.length ){
return;
}
$('.content').remove();
$('.helper').remove();
createDiv( window.results[window.theIndex] );
window.theIndex++;
setTimeout(displayNext, 4000);
}
function createDiv(status){
var tweets = status.text;
$("<span class='content'>")
.html(tweets)
.appendTo("body");
$("<span class='helper'>")
.appendTo("body")
}
</script>