Skip to content

Instantly share code, notes, and snippets.

@zenom
Created July 21, 2010 13:28
Show Gist options
  • Save zenom/484481 to your computer and use it in GitHub Desktop.
Save zenom/484481 to your computer and use it in GitHub Desktop.
<div class='entry box_entry tweet'>
<a href="http://www.twitter.com/kurtpellegrino" class="twitter_username" target="_blank"><h4>@kurtpellegrino</h4></a>
<a href="http://www.twitter.com/kurtpellegrino" class="alignleft preloading_background" target="_blank"><img class="rounded" height="20" width="20" src="http://a3.twimg.com/profile_images/1070233339/34116_1477610550536_1541924692_31206169_8054414_n_normal.jpg" /></a>
<p class='status'>
@stephanieMMA does she really wow
</p>
</div>
<div class='entry box_entry tweet'>
<a href="http://www.twitter.com/kurtpellegrino" class="twitter_username" target="_blank"><h4>@kurtpellegrino</h4></a>
<a href="http://www.twitter.com/kurtpellegrino" class="alignleft preloading_background" target="_blank"><img class="rounded" height="20" width="20" src="http://a3.twimg.com/profile_images/1070233339/34116_1477610550536_1541924692_31206169_8054414_n_normal.jpg" /></a>
<p class='status'>
RT @GreatestQuotes: "It's how you deal with failure that determines how you achieve success." - David Feherty
</p>
</div>
I am trying to count the items coming in below with $(data).each(".entry.box_entry.tweet"....), I keep getting an error of has no method .apply when I attempt to loop through them.
$(document).ready(function(){
var timestamp = 0;
var initial = 1;
var interval = setInterval('getTweets()', 2000);
getTweets = function(attribute) {
$.get("/tweets.html", {'initial': initial}, function(data) {
if(initial == 1) {
//console.log("Clearing and setting new timer...");
clearInterval(interval);
interval = setInterval("getTweets()", 5000);
initial = 0;
$("#tweets").html(data);
} else {
clearInterval(interval);
$(data).each(".entry.box_entry.tweet", function() {
console.log($(this));
})
}
});
}
getTweets();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment