diff options
author | Brandon Mathis <brandon@imathis.com> | 2011-09-28 00:53:31 -0500 |
---|---|---|
committer | Brandon Mathis <brandon@imathis.com> | 2011-09-28 00:53:54 -0500 |
commit | 9cf956cc96d0a337562a46bb1e695c4da31c88c4 (patch) | |
tree | 9b6de8fe8f59b80486a314fda7d8fc03c6d5022d /.themes/classic/source | |
parent | 9730e241b16b7e1b283f163bc38929ff76864014 (diff) | |
download | my_new_personal_website-9cf956cc96d0a337562a46bb1e695c4da31c88c4.tar.xz my_new_personal_website-9cf956cc96d0a337562a46bb1e695c4da31c88c4.zip |
added buffer for mentions in twitter stream
Diffstat (limited to '.themes/classic/source')
-rw-r--r-- | .themes/classic/source/javascripts/twitter.js | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/.themes/classic/source/javascripts/twitter.js b/.themes/classic/source/javascripts/twitter.js index 5b6b1240..b6fb0d87 100644 --- a/.themes/classic/source/javascripts/twitter.js +++ b/.themes/classic/source/javascripts/twitter.js @@ -49,7 +49,6 @@ function linkifyTweet(text, url) { if(url[u].expanded_url != null){ var shortUrl = new RegExp( url[u].url.replace(/https?:\/\//, ''), 'g'); text = text.replace(shortUrl, url[u].display_url); - console.log(text); } } return text @@ -66,11 +65,11 @@ function showTwitterFeed(tweets, twitter_user) { } function getTwitterFeed(user, count, replies) { + count = parseInt(count, 10); $.ajax({ - url: "http://api.twitter.com/1/statuses/user_timeline/" + user + ".json?trim_user=true&count=" + (parseInt(count, 10)) + "&include_entities=1&exclude_replies=" + (replies ? "0" : "1") + "&callback=?" + url: "http://api.twitter.com/1/statuses/user_timeline/" + user + ".json?trim_user=true&count=" + (count + 20) + "&include_entities=1&exclude_replies=" + (replies ? "0" : "1") + "&callback=?" , type: 'jsonp' , error: function (err) { $('#tweets li.loading').addClass('error').text("Twitter's busted"); } - , success: function(data) { showTwitterFeed(data, user); } + , success: function(data) { showTwitterFeed(data.slice(0, count), user); } }) } - |