Advertisement
Guest User

tweet watcher

a guest
Oct 26th, 2015
15
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement