Advertisement
Guest User

tweet watcher

a guest
Oct 26th, 2015
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. import subprocess
  2.  
  3. tweetchecker = subprocess.Popen(['java', '-jar', 'TweetWatcher/TweetWatcher.jar'], stdout=subprocess.PIPE)
  4. first = True
  5.  
  6. lines_iterator = iter(tweetchecker.stdout.readline, b"")
  7. for line in lines_iterator:
  8.     print line
  9.     if '@goshinbi' in line:     # watch for mentions to me
  10.         if not first:
  11.             subprocess.Popen(['mpg123', '-q', 'tweetMention.mp3'])
  12.         first = False
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement