tracker.py 609 B

1234567891011121314151617
  1. class Tracker:
  2. def __init__(self,board, words):
  3. self.known_posts = []
  4. self.words = words
  5. self.board = board
  6. def track(self):
  7. # for every post in some collection
  8. for post in collectionofposts:
  9. # for every word in word list
  10. for word in self.words:
  11. # if word in post and post not in known posts
  12. if word in post and not post.number in self.known_posts:
  13. # alert
  14. alert(post)
  15. # ignore for later
  16. self.known_posts.append(post.number)