开发者

How do I set up jTweetsAnywhere tweet filter

开发者 https://www.devze.com 2023-03-27 04:53 出处:网络
I am using开发者_JAVA百科 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 workin

I am using开发者_JAVA百科 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


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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号