summaryrefslogtreecommitdiffstats
path: root/source
diff options
context:
space:
mode:
authorSkyArrow <tommy351@gmail.com>2012-02-11 06:33:53 +0100
committerSkyArrow <tommy351@gmail.com>2012-02-11 06:33:53 +0100
commitc58b58114af82a202dc197f8af67a761f2186bf1 (patch)
treef2598e9764e6a760ed198ad794d5ce3c6c0d4c1e /source
parent79f4180d4226e7f3ae5f94e07eeaa9d2a3aa8314 (diff)
downloadoctopress-theme-jeyzu-c58b58114af82a202dc197f8af67a761f2186bf1.zip
octopress-theme-jeyzu-c58b58114af82a202dc197f8af67a761f2186bf1.tar.gz
twitter: exclude replies
Diffstat (limited to 'source')
-rw-r--r--source/_includes/banner.html2
-rw-r--r--source/javascripts/twitter.js6
2 files changed, 4 insertions, 4 deletions
diff --git a/source/_includes/banner.html b/source/_includes/banner.html
index 30fd246..f91ce3b 100644
--- a/source/_includes/banner.html
+++ b/source/_includes/banner.html
@@ -9,7 +9,7 @@
<script src="{{ root_url }}/javascripts/twitter.js"></script>
<script type="text/javascript">
(function($){
- $('#banner').getTwitterFeed('{{ site.twitter_user }}', {{ site.twitter_tweet_count }});
+ $('#banner').getTwitterFeed('{{ site.twitter_user }}', {{ site.twitter_tweet_count }}, {{ site.twitter_show_replies }});
})(jQuery);
</script>
{% endif %} \ No newline at end of file
diff --git a/source/javascripts/twitter.js b/source/javascripts/twitter.js
index c39bb25..00ecc36 100644
--- a/source/javascripts/twitter.js
+++ b/source/javascripts/twitter.js
@@ -1,5 +1,5 @@
(function($){
- $.fn.getTwitterFeed = function(userid, count){
+ $.fn.getTwitterFeed = function(userid, count, reply){
var banner = $(this),
feed = banner.find('.feed'),
interval = 10000,
@@ -52,9 +52,9 @@
}
if ($(window).width() > 600){
+ var url = 'https://api.twitter.com/1/statuses/user_timeline/'+userid+'.json?count='+count+'&exclude_replies='+(reply ? '0' : '1')+'&trim_user=true&callback=?';
banner.show();
-
- $.getJSON('https://api.twitter.com/1/statuses/user_timeline/'+userid+'.json?count='+count+'&trim_user=true&callback=?', function(json){
+ $.getJSON(url, function(json){
var length = json.length,
fragment = document.createDocumentFragment(),
counts = 0,