user141621
user141621

Reputation:

How do I set up jTweetsAnywhere tweet filter

I am using jTweetsAnywhere (http://thomasbillenstein.com/jTweetsAnywhere/#jta_usage) and need to filter the tweets to exclude certain tweets with words. I have this but it isn't working and there is no examples of how to set this up.

 $('#Tweets').jTweetsAnywhere({
            searchParams: ['q=sliderobes'],
            TweetFilter: ['kids'],
            count: 3,
            showTweetFeed: {
                showProfileImages: true,
                showUserScreenNames: false
            }
        })

Thanks for any help, C

Upvotes: 1

Views: 645

Answers (1)

Rup
Rup

Reputation: 34418

It's lower-case t tweetFilter and it's a function that accepts tweet - a JSON tweet object straight from the twitter API - and options, the plugin options object. For example

tweetFilter : function(tweet, options) {
    if (tweet && tweet.text) {
        var text = tweet.text;

        // Reject tweets that mention 'Kids'
        if (text.match(/kids/i)) {
            return false;
        }

        // Passed all filters
        return true;
    }
    // else no object or text - reject
    return false;
}

Upvotes: 1

Related Questions