Permalink
Browse files

Update plugins/tweets/tweets.php

Added a parameter to hide replies from your stream. Can be enabled by passing parameter 'hiderep = true'.
Useful for twitter accounts that have a high ratio of replies that aren't of general interest.
  • Loading branch information...
adrianthomas committed Jan 4, 2013
1 parent 7e91f41 commit ca93de065564f92ea9e4b17d07b9e26adaba62c3
Showing with 3 additions and 2 deletions.
  1. +3 −2 plugins/tweets/tweets.php
@@ -5,6 +5,7 @@ function tweets($username, $params=array()) {
$defaults = array(
'limit' => 10,
'cache' => true,
+ 'hiderep' => false, //Parameter to hide replies in your feed - for accounts with high reply volumes
'refresh' => 60*20 // refresh every 20 minutes
);
@@ -34,7 +35,7 @@ function tweets($username, $params=array()) {
if(!empty($cache)) return $cache;
- $url = 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=' . $options['username'] . '&count=' . $options['limit'] . '&include_rts=true';
+ $url = 'http://api.twitter.com/1/statuses/user_timeline.json?screen_name=' . $options['username'] . '&count=' . $options['limit'] . '&include_rts=true' . '&exclude_replies=' . $options['hiderep'];
$json = @file_get_contents($url);
$data = str::parse($json);
@@ -89,4 +90,4 @@ static function link($text) {
return $text;
}
-}
+}

0 comments on commit ca93de0

Please sign in to comment.