-
-
Save Zulko/f8735acf94cc97d6c53d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Rewrite with Twittcher ;) (Not tested) | |
| ''' | |
| import twittcher | |
| watched_words = ["racist", "white", "teargas", "rifle", "camera", "milk"] | |
| wordcounts = {word:0 for word in watched_words} | |
| def action(tweet): | |
| found_at_least_one = False | |
| for word in watched_words: | |
| if word in tweet.text: | |
| wordcounts[word] += 1 | |
| found_at_least_one = True | |
| if found_at_least_one: | |
| print( "Found one ! Current count:", wordcounts) | |
| bot = SearchWatcher("ferguson", action=action) | |
| bot.watch_every(20) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment