Filter @replies on Twitter feed?

I have a feed from my Twitter profile at the top of my site, but I wondered if there is a way to filter my @replies and only show my status updates?

thanks

+5
source share
6 answers

If you use the standard Twitter feed web code for Blogger and similar sites, this Javascript bit does the trick. It is between the Twitter feed and the callback responses and the responses from the server response.

For a blog icon, the standard Twitter web code ends with two tags <script>. The first provides a feature that displays your tweets. The second twitter request to display tweets.

script twitter. , filterCallback, @replies Twitter.

<script type="text/javascript">
  function filterCallback( twitter_json ) {
    var result = [];
    for(var index in twitter_json) {
      if(twitter_json[index].in_reply_to_user_id == null) {
        result[result.length] = twitter_json[index];
      }
      if( result.length==5 ) break; // Edit this to change the maximum tweets shown
    }
    twitterCallback2(result); // Pass tweets onto the original callback. Don't change it!
  }
  </script>

twitter , , , . "twitterCallback2" - - ( callback=twitterCallback2). , twittercallback2 filterCallback. , twittercallback2, .

, , Twitter , count , . - , .

: Twitter

+4
+6

Twitter, features: :

filters: {
  negatives: /\B@\w{1,20}(\s+|$)/
},

Dustin Diaz http://www.dustindiaz.com. - Twitter.

+3

setUser

setUser('name&exclude_replies=true');

,

+1

, . Twitter, , , . - , , (, ..), , , .

0

, . - :

[a-zA-Z0-9][a-zA-Z0-9]*: @[a-zA-Z0-9][a-zA-Z0-9]*.*

, Twitter . , - :

username: @username msg txt

, . , .:) , .

0
source

All Articles