How do I set up jTweetsAnywhere tweet filter
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;
}
精彩评论