2011-08-10 8 views
1

jTweetsAnywhere (http://thomasbillenstein.com/jTweetsAnywhere/#jta_usage)를 사용 중이며 트윗을 필터링하여 단어가있는 특정 트윗을 제외해야합니다. 나는 이것을 가지고 있지만 작동하지 않으며이를 설정하는 예제가 없다. 어떤 도움jTweetsAnywhere 짹짹 필터를 설정하는 방법

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

감사합니다, C

답변

1

그것은 소문자 t tweetFilter 그리고 그것은 tweet을 받아들이는 기능입니다 - 바로 트위터 API에서 JSON 짹짹 객체 - 그리고 options, 플러그인 옵션은 객체. 예 :

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

의견을 보내 주셔서 감사합니다. 필터링 할 단어를 여러 개 추가 할 수 있습니까? –

+0

물론, 원하는 로직을 함수에 넣을 수 있습니다. 원하는 경우 해당 정규 표현식 테스트를 여러 번 반복 할 수 있습니다. – Rup

관련 문제